flink 单节点安装

Last updated on November 20, 2024 am

🧙 Questions

flink 安装文档 (1.14.0 scala-2.12)

☄️ Ideas

前提

下载安装包
cd /tmp
nohup wget https://archive.apache.org/dist/flink/flink-1.14.0/flink-1.14.0-bin-scala_2.12.tgz >> download_flink.log 2>&1 &
tail -f download_flink.log
解压安装
sudo mkdir -p /data/flink
sudo chown -R ispong:ispong /data/flink
tar -vzxf flink-1.14.0-bin-scala_2.12.tgz -C /data/flink/
sudo ln -s /data/flink/flink-1.14.0 /opt/flink
配置环境变量
sudo vim /etc/profile
export FLINK_HOME=/opt/flink
export PATH=$PATH:$FLINK_HOME/bin

# flink on yarn 一定要配置
export YARN_CONF_DIR=/opt/hadoop/etc/hadoop
source /etc/profile
修改配置(可选)
vim /opt/flink/conf/flink-conf.yaml
# 端口号,默认端口号 8081
# 使用yarn部署,不需要配置端口号
# rest.port: 30114

# 可选
taskmanager.numberOfTaskSlots: 20

-jm 主节点内存
-tm 从节点内存
-d 后台运行

slots 不能超过yarn容器最大虚拟内核数 (yarn.scheduler.maximum-allocation-vcores)

yarn-session.sh \
  --jobManagerMemory 4096 \
  --taskManagerMemory 4096 \
  --name isxcode-flink-cluster \
  --slots 4 \
  -d

20221104160923

20221104161013

20221104161049

如果要使用本地一定要删除这个文件,否则一直会提交到yarn中

rm /tmp/.yarn-properties-ispong

20221104171459

最好在$flink目录下执行启动命令,否则flink无法找到配置文件
关闭flink
cd /opt/flink
bash ./bin/stop-cluster.sh

cd /opt/flink
bash ./bin/start-cluster.sh

默认端口号8081

安装测试(可选)
flink run /opt/flink/examples/streaming/WordCount.jar
tail /opt/flink/log/flink-*-taskexecutor-*.out

flink 单节点安装
https://ispong.isxcode.com/hadoop/flink/flink 单节点安装/
Author
ispong
Posted on
August 9, 2021
Licensed under