一、Standalone模式
1.1 下载flink安装包
https://flink.apache.org/downloads.html
1.2 安装 flink
解压即可
1.3 配置文件
-
vim conf/flink-conf.yaml
jobmanager.rpc.address: kino-cdh01 # 集群管理器,管理job的rpc通信地址 # The RPC port where the JobManager is reachable. jobmanager.rpc.port: 6123 # 内部通信端口 # The heap size for the JobManager JVM jobmanager.heap.size: 1024m # jobmanager(对应spark的driver) 默认堆内存大小 # The heap size for the TaskManager JVM taskmanager.heap.size: 1024m # taskmanager(执行任务, 对应spark的executor) 默认堆内存大小 # The number of task slots that each TaskManager offers. Each slot runs one parallel pipeline. taskmanager.numberOfTaskSlots: 1 # 当前taskmanager 能提供的线程数 # The parallelism used for programs that did not specify and other parallelism. parallelism.default: 1 # 实际执行的 并行度
-
vim conf/slaves:
kino-cdh02 kino-cdh03
-
分发给另外两台机子
scp -r /usr/local/flink-1.9.2 kino-cdh02:/usr/local/ scp -r /usr/local/flink-1.9.2 kino-cdh03:/usr/local/
-
启动
[root@kino-cdh01 flink-1.9.2]# bin/start-cluster.sh Starting cluster. Starting standalonesession daemon on host kino-cdh01. Starting taskexecutor daemon on host kino-cdh02. Starting taskexecutor daemon on host kino-cdh03.
访问 http://localhost:8081 可以对flink集群和任务进行监控管理。