Flink安装的三种方式
通用配置
-
解压
-
tar -zxf /chinaskills/flink-1.14.0-bin-scala_2.12.tgz -C /opt/
-
-
配置环境变量
-
vi /root/.bash_profile export FLINK_HOME=/opt/flink-1.14.0 export PATH=$PATH:$FLINK_HOME/bin
-
local模式安装
-
启动
-
#切换到bin目录下 ./start-cluster.sh #启动节点 17917 TaskManagerRunner 17648 StandaloneSessionClusterEntrypoint
-
-
提交
-
flink run ../examples/batch/WordCount.jar (whether,1) (whips,1) (who,2) (whose,1) (will,1) (wish,1) (with,3) (would,2) (wrong,1) (you,1)
-
Standalone模式安装
-
修改配置文件
-
修改flink-conf.yaml文件
-
jobmanager.rpc.address: master
-
-
修改masters文件
-
master:8081
-
-
修改works文件
-
master slave1 slave2
-
-
-
分发环境变量和软件目录
-
scp /root/.bash_profile slave1:/root/.bash_profile scp /root/.bash_profile slave1:/root/.bash_profile scp -r flink-1.10.2 slave1:$PWD scp -r flink-1.10.2 slave2:$PWD
-
-
启动
-
#切换到bin目录下 ./start-cluster.sh
-
-
提交运行(取结果的后十行)
-
flink run -m master:8081 -p 2 ../examples/batch/WordCount.jar (weary,1) (when,2) (whips,1) (who,2) (whose,1) (will,1) (wish,1) (would,2) (wrong,1) (you,1)
-
yarn模式安装
-
添加环境变量
-
vi /root/.bash_profile export HADOOP_CLASSPATH=$(/opt/hadoop-3.1.3/bin/hadoop classpath)
-
-
on yarn 模式提交运行
-
flink run -m yarn-cluster -p 2 -yjm 2G -ytm 2G $FLINK_HOME/examples/batch/WordCount.jar (weary,1) (when,2) (whips,1) (who,2) (whose,1) (will,1) (wish,1) (would,2) (wrong,1) (you,1)
-