躬行系列-Flink部署

337 阅读1分钟

下载

www.apache.org/dyn/closer.…

三种部署模式

stand alone(会话模式)

pre job(单作业模式-生产中使用这个,需要和k8s或yarn一同部署)

application(应用模式)

配置

stand alone模式(以下部署只是作为hello world级别的测试环境。不要作为生产环境部署)

作为一个刚上手的小白,flink配置相当简单,好评。

注意,你的flink集群在各个机器上的部署位置必须完全一致。

配置文件修改如下: /usr/local/flink-1.16.0/conf/flink-conf.yaml

jobmanager.rpc.address: 192.168.0.118
rest.port: 8081
rest.bind-address: 0.0.0.0

/usr/local/flink-1.16.0/conf/masters

192.168.0.118:8081

/usr/local/flink-1.16.0/conf/workers

192.168.0.118
192.168.0.119
192.168.0.120

常用命令

启:./start-cluster.sh

停:./stop-cluster.sh

yarn pro job模式

前提:配置好hadoop的环境变量即可

命令:./flink run -d -t yarn-pro-job -c com.xxx.xxx.xxx xxx.jar