当前位置:网站首页>Flink cluster construction
Flink cluster construction
2022-08-01 21:33:00 【xiexiexie0520】
Flink cluster setup
Local run mode
You can run it in IDEA, mainly for development
StandAlone Mode
Flink's own resource management framework does not need to depend on any other framework
1, upload and decompress
tar -zxvf flink-1.11.2-bin-scala_2.11.tgz -C /usr/local/soft/2. Modify environment variables
vim /etc/profile# Configure flink's bin directory to the environment variable PATH3. Modify the configuration file
cd /usr/local/soft/flink-1.11.2/confvim flink-conf.yaml# Change localhost to masterjobmanager.rpc.address: master# configure slave nodevim workersnode1node2# Modify the master addressvim mastersmaster:80814, sync to node1, node2
cd /usr/local/soft/scp -r flink-1.11.2/ node1:`pwd`scp -r flink-1.11.2/ node2:`pwd`5. Start the cluster
# Only run on masterstart-cluster.sh6. Access Flink's WEB UI
http://master:80817. Submit task
Submit tasks through the flink command
flink run -c com.shujia.core.Demo01WordCount Flink-1.0.jarSubmit tasks through the web interface
Submit tasks via RPC remote calls
8. Stop the cluster
stop-cluster.shOn Yarn Mode
Mainstream operation mode, mainly used in production environment
yarn-session first starts a jobMansager in yarn, and all tasks share a jobmanager (submit tasks faster, share jobmanager between tasks, and affect each other)
Submit the task model directly, start a jobmanager for each task (each task is independent jobmanager, the task runs stably)
Preparation
Configure environment variables, add HADOOP_CONF_DIR
vim /etc/profileexport HADOOP_CONF_DIR=/usr/local/soft/hadoop-2.7.6/etc/hadoop/Add HADOOP dependencies
cp flink-shaded-hadoop-2-uber-2.7.5-10.0.jar /usr/local/soft/flink-1.11.2/lib/Start Hadoop cluster
# Execute on masterstart-all.sh
Yarn-Session Mode
It is equivalent to starting a JobManager in Yarn. When a task is submitted, it will apply for the TaskManager required for resource startup according to the parallelism of the task
- Start:
yarn-session.sh -jm 1024m -tm 1024m - Access: there is an address in the log after startup or jump through Yarn WEB UI
- Submit tasks:
- Command:
flink run -c com.shujia.core.Demo01WordCount Flink-1.0.jar - Submit via page
- Submit via RPC
- Command:
Direct On Yarn
It is equivalent to generating a JobManager each time a task is submitted
Just start Yarn
Flink tasks can only be submitted using commands
flink run -m yarn-cluster -yjm 1024m -ytm 1024m -c com.shujia.core.Demo01WordCount Flink-1.0.jarStop task
Cancel via the Cancel button on the JobManager interface
kill via Yarn's command
yarn application -kill application_1654850164441_0002
View logs
yarn logs -applicationId application_1654850164441_0002
边栏推荐
- JS hoisting: how to break the chain of Promise calls
- WEB渗透之SQL 注入
- LeetCode·每日一题·1374.生成每种字符都是奇数个的字符串·模拟
- 2022-08-01 第五小组 顾祥全 学习笔记 day25-枚举与泛型
- 线上一次JVM FullGC搞得整晚都没睡,彻底崩溃~
- 图片识别商品接口 API:天猫淘宝
- WEB 渗透之端口协议
- An online JVM FullGC made it impossible to sleep all night and completely crashed~
- 二分法中等 LeetCode6133. 分组的最大数量
- 通过这两个 hook 回顾 Set/Map 基础知识
猜你喜欢
随机推荐
LeetCode·32.最长有效括号·栈·动态规划
2022牛客多校联赛第五场 题解
宝塔应用使用心得
通过这两个 hook 回顾 Set/Map 基础知识
XSS漏洞
树莓派的信息显示小屏幕,显示时间、IP地址、CPU信息、内存信息(c语言),四线的i2c通信,0.96寸oled屏幕
15 分钟带你入门 Grafana
这些 hook 更优雅的管理你的状态
上传markdown文档到博客园
LeetCode·每日一题·1374.生成每种字符都是奇数个的字符串·模拟
[Chinese tree tags - CTB]
JS Improvement: Handwritten Publish Subscriber Model (Xiaobai)
R语言 数据的关系探索
C陷阱与缺陷 第7章 可移植性缺陷 7.8 随机数的大小
C专家编程 前言
C陷阱与缺陷 第7章 可移植性缺陷 7.7 除法运算时发生的截断
基于php动漫周边商城管理系统(php毕业设计)
PX4模块设计之十五:PX4 Log设计
JSD-2204-Knife4j框架-处理响应结果-Day07
ISC2022 HackingClub白帽峰会倒计时1天!最全议程正式公布!元宇宙集结,精彩绝伦!








