Flink4:Local模式部署

Flink4:Local模式部署

 

1.0 环境需求

  • Java:java8或者java11
  • Flink:flink-1.14.3

1. 解压

root@redis01:/usr/local# tar -zxvf flink-1.14.3-bin-scala_2.12.tgz

2. 重命名

# 重命名 root@redis01:/usr/local# mv flink-1.14.3 flink-local

3. 启动

root@redis01:/usr/local/flink-local# ./bin/start-cluster.sh

4. 启动失败

  • 使用jps查看,flink进程始终没有启动
  • 进入日志log文件夹查看
root@redis01:/usr/local/flink-local/log# cat flink-root-taskexecutor-3-redis01.log
notion image
发现报错
notion image
查阅stackoverflow发现,Flink目前对java8、java11支持友好,我使用的是java17🤣
root@redis01:/usr/local/flink-local/log# java -version openjdk version "17.0.1" 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12-Ubuntu-120.04) OpenJDK 64-Bit Server VM (build 17.0.1+12-Ubuntu-120.04, mixed mode, sharing)

5. 修改Java版本

6. 启动

root@redis01:/usr/local/flink-local# ./bin/start-cluster.sh
查看Flink进程,已经成功启动了🎉
notion image
 

7. 访问Web UI

默认地址:localhost:8081
notion image
 

8. 停止Flink

root@redis01:/usr/local/flink-local# ./bin/stop-cluster.sh