Flink之三 flink on yarn
Flink的執行模式
flink的執行模式有local模式,cluster,yarn等模式;flink叢集層次結構
這一節我們主要一起了解flink on yarn 模式,flink on yarn 有兩種模式:
一:long-running Flink cluster on YARN
二 : run a Flink job on YARN
Start a long-running Flink cluster on YARN
第一步:啟動yarn
第二步:啟動flink
當日志打印出如下資訊時候,說明flink啟動成功;
在yarn上啟動flink後,flink會被yarn當做一個application執行,
點選applicationMaster 進入flink的web介面
flink的jar可以通web頁面上傳
單擊submit後就會自動執行;執行後可以completed job中檢視歷史job資訊
備註:
-
Use the following command to start a session
-
./bin/yarn-session.sh
-
This command will show you the following overview:
-
Usage:
-
Required
-
-n,--container <arg> Number of YARN container to allocate (=Number of Task Managers)
-
Optional
-
-D <arg> Dynamic properties
-
-d,--detached Start detached
-
-jm,--jobManagerMemory <arg> Memory for JobManager Container [in MB]
-
-nm,--name Set a custom name for the application on YARN
-
-q,--query Display available YARN resources (memory, cores)
-
-qu,--queue <arg> Specify YARN queue.
-
-s,--slots <arg> Number of slots per TaskManager
-
-tm,--taskManagerMemory <arg> Memory per TaskManager Container [in MB]
-
-z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for HA mode
以上就是在yarn執行一個flink集群后,在提交作業,下面直接在yarn上提交job作業;
Run a Flink job on YARN
提交後進程數和single flink on yarn 有區別,不會有yarntaskManager 程序
執行時,單擊application會自動調轉到flinkweb頁面