Flink部署
flink1.12 jar下载
cd /opt
wget https://archive.apache.org/dist/flink/flink-1.12.0/flink-1.12.0-bin-scala_2.11.tgz
解压
tar -zxvf flink-1.12.0-bin-scala_2.11.tgz
修改配置文件
vim conf/flink-conf.yaml
把值修改成以下内容
cluster2-hadoop01-tst-daas-deepexi:8020只是本案例的,具体替换成集群Namenode端口
state.backend: rocksdb
state.checkpoints.dir: hdfs://cluster2-hadoop01-tst-daas-deepexi:8020/daas/flink/checkpoints/
state.savepoints.dir: hdfs://cluster2-hadoop01-tst-daas-deepexi:8020/daas/flink/savepoints/
state.backend.incremental: true
state.checkpoints.num-retained: 3
jobmanager.archive.fs.dir: hdfs://cluster2-hadoop01-tst-daas-deepexi:8020/daas/flink/flink-jobs/
historyserver.web.address: cluster2-hadoop01-tst-daas-deepexi
historyserver.web.port: 8082
historyserver.archive.fs.dir: hdfs://cluster2-hadoop01-tst-daas-deepexi:8020/daas/flink/flink-jobs/
修改环境变量
vim /etc/profile export FLINK_HOME=/opt/flink export PATH=$PATH:$FLINK_HOME/bin
分发服务器
把修改好的 flink文件 分发到集群所有机子
测试是否成功
flink run -m yarn-cluster /opt/flink/examples/batch/WordCount.jar