当前位置:网站首页>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 PATH
3. 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:8081
4, 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.sh
6. Access Flink's WEB UI
http://master:8081
7. Submit task
Submit tasks through the flink command
flink run -c com.shujia.core.Demo01WordCount Flink-1.0.jar
Submit tasks through the web interface
Submit tasks via RPC remote calls
8. Stop the cluster
stop-cluster.sh
On 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.jar
Stop 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
边栏推荐
- R语言 数据的关系探索
- Appendix A printf, varargs and stdarg a. 2 use varargs. H to realize the variable argument list
- C Pitfalls and pitfalls Appendix B Interview with Koenig and Moo
- LVS负载均衡群集
- How to choose Visibility, Display, and Opacity when interacting or animating
- LeetCode
- Transformer学习
- 【Objective-C中的@synthesize】
- WEB渗透之SQL 注入
- R语言进行相关的操作
猜你喜欢
随机推荐
磷酸化甘露糖苷修饰白蛋白纳米粒/卵白蛋白-葡聚糖纳米凝胶的
C pitfalls and pitfalls Chapter 8 Suggestions and answers 8.2 Answers
property语法
回收租凭系统100%开源无加密 商城+回收+租赁
ahooks 是怎么处理 DOM 的?
测试的意义并不是能找到全部的缺陷
图的邻接矩阵存储
R语言进行相关的操作
关于npm的那些事儿
C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.3 The Standard I/O Library and the C Preprocessor
方舟:生存进化PVE模式和PVP模式
P7215 [JOISC2020] 首都 题解
C陷阱与缺陷 第7章 可移植性缺陷 7.9 大小写转换
JS提升:如何中断Promise的链式调用
HCIP---企业网的架构
Jmeter实战 | 同用户重复并发多次抢红包
C Pitfalls and Defects Chapter 7 Portability Defects 7.9 Case Conversion
R语言 线性回归的有关方法
如何让定时器在页面最小化的时候不执行?
C专家编程 第1章 C:穿越时空的迷雾 1.2 C语言的早期体验