Flink部署
安装前准备
1.1. 添加环境变量
vi /etc/profile
export FLINK_HOME=/opt/flink
export PATH=$PATH:$FLINK_HOME/bin
source /etc/profile
1.2. 创建用户和用户组
groupadd flink
useradd -g flink flink
安装flink
1.3. 解压安装包
tar -zxf flink-1.16.2.tar.gz -C /opt
1.4. 复制文件
scp -rp /opt/flink-1.16.2 172.16.38.{10,11,12,218,220,221,222}:/opt
ln -s /opt/flink-1.16.2 /opt/flink
1.5. 修改权限
chown flink:flink -R /opt/flink-1.16.2
配置flink
1.6. 配置flink-conf.yaml文件
jobmanager.rpc.address: 172.16.38.222
jobmanager.memory.process.size: 1600m
taskmanager.memory.process.size: 1728m
taskmanager.numberOfTaskSlots: 1
parallelism.default: 1
jobmanager.execution.failover-strategy: region
rest.port: 8088
rest.address: 172.16.38.222
historyserver.web.address: 172.16.38.222
historyserver.web.port: 8083
jobmanager.archive.fs.dir: hdfs://mycluster:8020/flink/completed-jobs/
historyserver.archive.fs.dir: hdfs://mycluster:8020/flink/completed-jobs/
1.7. 配置masters文件
vim /opt/flink/conf/masters
内容如下:
DPS2-DA-qas4:8088
1.8. 配置workers文件
vim /opt/flink/conf/workers
内容如下:
DPS2-DA-qas1
DPS2-DA-qas2
DPS2-DA-qas3
启动flink
su - flink
start-cluster.sh