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页面