大数据全系列 教程
1869个小节阅读:467.2k
目录
408考研
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
启动hadoop集群(也可以仅启动HDFS集群)
xxxxxxxxxx
[root@node1 ~]# startha.sh
将测试数据文件从PC机上传到node1的/root目录下
将node1的/root/words上次到hdfs文件系统中
xxxxxxxxxx
[root@node1 ~]# hdfs dfs -mkdir -p /wordcount/input/
[root@node1 ~]# hdfs dfs -put /root/words /wordcount/input/
xxxxxxxxxx
#--input指定处理数据文件路径
#--output指定处理结果数据的存储文件
/opt/flink-salone/bin/flink run \
/opt/flink-salone/examples/batch/WordCount.jar \
--input hdfs://mycluster/wordcount/input/words \
--output hdfs://mycluster/wordcount/output/result
xxxxxxxxxx
[root@node1 ~]# hdfs dfs -text /wordcount/output/result
#或者
[root@node1 ~]# hdfs dfs -cat /wordcount/output/result
WebUI提交测试
首先将/opt/flink-salone/examples/batch/WordCount.jar下载到D盘根目录
上传作业
输入参数提交作业
--input hdfs://mycluster/wordcount/input/words --output hdfs://mycluster/wordcount/output/result2
执行成功界面
查看结果
关闭Standalone集群服务
xxxxxxxxxx
[root@node1 ~]# /opt/flink-salone/bin/stop-cluster.sh
Stopping taskexecutor daemon (pid: 5755) on host node1.
Stopping taskexecutor daemon (pid: 4400) on host node2.
Stopping taskexecutor daemon (pid: 4791) on host node3.
Stopping standalonesession daemon (pid: 5457) on host node1.