Flink集群部署
1.下载安装包,flink-1.12.0-bin-scala_2.12.tgz
下载地址:https://flink.apache.org/downloads.html
2.解压安装包,tar -zvxf ./ flink-1.12.0-bin-scala_2.12.tgz -C ../software/
3.进入flink目录:cd flink-1.12.0
4.修改master, vi ./conf/ masters ,添加连个master服务器ip和端口
5.修改slaves ,vi./conf/ slaves,添加slaves服务器信息
6.修改flink-conf.yaml文件
high-availability: zookeeper
high-availability.zookeeper.quorum: 192.168.0.20:2181, 192.168.0.21,192.168.0.22:2181
high-availability.zookeeper.path.root: /flink
high-availability.cluster-id: /default_one
high-availability.zookeeper.storageDir: hdfs:///flink/recovery
7.修改zoo.cfg 文件:
server.1=192.168.0.20:2888:3888
server.2=192.168.0.21:2888:3888
server.3=192.168.0.22:2888:3888
8.修改/etc/profile文件,vi /etc/profile
export FLINK_HOME=/root/software/flink-1.12.0
export PATH=$FLINK_HOME/bin:$PATH
9.使profile文件生效,source /etc/profile
10.将flink拷贝到其他节点:
Scp ./ flink-1.12.0 -r root@192.168.0.22: /root/software/
Scp ./ flink-1.12.0 -r root@192.168.0.21: /root/software/
11.155和156两台机器分别配置profile文件
12.启动flink集群
/bin/start-cluster.sh
启动成功后,可打开flink ui界面:192.168.0.20:8081