当前位置:网站首页>Flink集群搭建以及企业级yarn集群搭建
Flink集群搭建以及企业级yarn集群搭建
2022-06-24 09:46:00 【少年鹿】
Flink下载:
根据自己想要下载的版本,下载指定版本我下载的是7.2hadoop版本
解压后启动:
本地启动
[[email protected] flinkhadoop1.7.2]# bin/start-scala-shell.sh local
本地提交一个job
scala> benv.readTextFile("/home/admin/word.txt").flatMap(_.split(" ")).map((_,1)).groupBy(0).sum(1).print()

单机集群启动:
[[email protected] flinkhadoop1.7.2]# bin/start-cluster.sh
Starting cluster.
Starting standalonesession daemon on host node01.
Starting taskexecutor daemon on host node01.
[[email protected] flinkhadoop1.7.2]# jps
28417 StandaloneSessionClusterEntrypoint
29013 Jps
28858 TaskManagerRunner
页面查看启动集群

提交任务到flink 单节点集群
[[email protected] flinkhadoop1.7.2]# bin/flink run /home/admin/flinkhadoop1.7.2/examples/batch/WordCount.jar --input /home/admin/word.txt --output /home/admin/out

前端查看上传的任务
执行计划:


输出文件展示
[[email protected] flinkhadoop1.7.2]# cat /home/admin/out flink 1 hello 6 java 1 storm 1 stream 2 world 1
停止集群:
bin/stop-cluster.sh

jobmanager.rpc.address: node01
jobmanager.rpc.port: 6123
jobmanager.heap.size: 1024
taskmanager.heap.size: 1024
taskmanager.numberOfTaskSlots: 2
taskmanager.memory.preallocate: false
parallelism.default: 1
jobmanager.web.port: 8081
taskmanager.tmp.dirs: /home/user/apps/flink/tmp
#页面提交
web.submit.enable: true
[[email protected] flinkhadoop1.7.2]# vim conf/masters 192.168.36.138:8081
[[email protected] flinkhadoop1.7.2]# vim conf/slaves 192.168.36.138 192.168.36.139 192.168.36.140
hadoop下载
https://archive.apache.org/dist/hadoop/core/hadoop-2.7.5/
hadoop集群部署:
保姆级Hadoop集群部署_程序员小王java的博客-CSDN博客
单机部署hadoop:
单机部署hadoop2.7.3_程序员小王java的博客-CSDN博客_hadoop2.7.3
hadoop访问:
http://node01:50070/dfshealth.html#tab-overview
/usr/soft/hadoop-2.7.3/sbin/stop-dfs.sh /usr/soft/hadoop-2.7.3/sbin/start-dfs.sh
hadoop创建文件: hdfs dfs -mkdir -p /word #1. 查看hdfs文件系统目录文件 hdfs dfs -ls /word #2.上传: hdfs dfs -put 本地文件目录 HDFS文件目录 hdfs dfs -put /usr/apps/word/words.txt /word #3.删除文件 hdfs dfs -rm -r HDFS文件路径 hdfs dfs -rm -r /word
集群搭建过程中,可能出现的问题:
- 端口被占用,我们需要手动杀掉占用端口的程序;
- 目录找不到或者文件找不到,我们在 flink-conf.yaml 中配置过 io.tmp.dirs ,这个目录需要手动创建
flink -hadoop高可用集群和yarn需要 对应的flink-hadoop依赖,下载地址
命令:
./bin/flink run -m yarn-cluster -yid application_xxxx ./examples/batch/WordCount.jar
yarn上运行任务./bin/flink run -yjm 1024m -ytm 4096m -ys 2 ./examples/batch/WordCount.jar
启动集群
bin/start-cluster.sh
停止集群
bin/stop-cluster.sh
附件FLink技术数据可以参考:
边栏推荐
- 3. addition, deletion, modification and query of employees
- p5.js实现的炫酷交互式动画js特效
- leetCode-2221: 数组的三角和
- 线程调度的常用方法
- Three ways to use applicationcontextinitializer
- Role of message queuing
- numpy.logical_or
- canvas管道动画js特效
- 记录一下MySql update会锁定哪些范围的数据
- CVPR 2022 oral | NVIDIA proposes an efficient visual transformer network a-vit with adaptive token. The calculation of unimportant tokens can be stopped in advance
猜你喜欢

正规方程、、、

uniapp开发微信小程序,显示地图功能,且点击后打开高德或腾讯地图。

上升的气泡canvas破碎动画js特效

411 stack and queue (20. valid parentheses, 1047. delete all adjacent duplicates in the string, 150. inverse Polish expression evaluation, 239. sliding window maximum, 347. the first k high-frequency

CVPR 2022 oral | NVIDIA proposes an efficient visual transformer network a-vit with adaptive token. The calculation of unimportant tokens can be stopped in advance

uniapp 开发微信公众号,下拉框默认选中列表第一个

SQL Server AVG函数取整问题

Cookie encryption 4 RPC method determines cookie encryption

形状变化loader加载jsjs特效代码

Nvisual digital infrastructure operation management software platform
随机推荐
上升的气泡canvas破碎动画js特效
canvas无限扫描js特效代码
23. Opencv——图像拼接项目
学习使用php实现无限极评论和无限极转二级评论解决方案
CVPR 2022 Oral | 英伟达提出自适应token的高效视觉Transformer网络A-ViT,不重要的token可以提前停止计算
Tutorial (5.0) 08 Fortinet security architecture integration and fortixdr * fortiedr * Fortinet network security expert NSE 5
机器学习——感知机及K近邻
numpy.logical_or
411 stack and queue (20. valid parentheses, 1047. delete all adjacent duplicates in the string, 150. inverse Polish expression evaluation, 239. sliding window maximum, 347. the first k high-frequency
2022-06-23: given a nonnegative array, select any number to make the maximum cumulative sum a multiple of 7, and return the maximum cumulative sum. N is larger, to the 5th power of 10. From meituan. 3
Status of the thread pool
牛客-TOP101-BM28
Web site development, lazy image loading
分布式 | 如何与 DBLE 进行“秘密通话”
leetCode-面试题 16.06: 最小差
线程池的执行流程
JMeter接口测试工具基础 — Badboy工具
leetCode-929: 独特的电子邮件地址
形状变化loader加载jsjs特效代码
Get the QR code of wechat applet with parameters - and share the source code of modifying the QR code logo
https://blog.csdn.net/weixin_44385486/article/details/124197370?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165552127416782388044840%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165552127416782388044840&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-3-124197370-null-null.nonecase&utm_term=flink&spm=1018.2226.3001.4450