|NO.Z.00013|——————————|^^ 部署 ^^|——|Hadoop&Hadoop核心框架.V13|——|Hadoop.v13|集群测试|
一、集群测试
### --- HDFS 分布式存储初体验
~~~ 从linux本地文件系统上传下载文件验证HDFS集群工作正常
~~~ # 本地hoome目录创建一个文件
[root@linux121 ~]# vim test.txt
hello hdfs
~~~ # 创建一个目录
[root@linux121 ~]# hdfs dfs -mkdir -p /test/input
~~~ # 上传linxu文件到Hdfs
[root@linux121 ~]# hdfs dfs -put /root/test.txt /test/input
~~~ # 从Hdfs下载文件到linux本地
[root@linux121 ~]# hdfs dfs -get /test/input/test.txt
### --- MapReduce 分布式计算初体验
~~~ # 在HDFS文件系统根目录下面创建一个wcinput文件夹
[root@linux121 ~]# hdfs dfs -mkdir /wcinput
~~~ # 在/root/目录下创建一个wc.txt文件(本地文件系统)
[root@linux121 ~]# touch wc.txt
~~~ # 编辑wc.txt文件
[root@linux121 ~]# vim wc.txt
# 在文件中输入如下内容
hadoop mapreduce yarn
hdfs hadoop mapreduce
mapreduce yarn yanqi
yanqi
yanqi
~~~ # 上传wc.txt到Hdfs目录/wcinput下
[root@linux121 ~]# hdfs dfs -put wc.txt /wcinput
~~~ # 回到Hadoop目录/opt/yanqi/servers/hadoop-2.9.2:执行程序
[root@linux121 ~]# cd /opt/yanqi/servers/hadoop-2.9.2
[root@linux121 hadoop-2.9.2]# hadoop jar /opt/yanqi/servers/hadoop-2.9.2/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.9.2.jar wordcount /wcinput /wcoutput
~~~ # 查看结果
[root@linux121 hadoop-2.9.2]# hdfs dfs -cat /wcoutput/part-r-00000
hadoop 2
hdfs 1
mapreduce 3
yanqi 3
yarn 2
二、查看详细日志:http://linux123:8088/

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通