|NO.Z.00007|——————————|Deployment|——|Hadoop&Spark环境部署.v07|——|Hadoop.v07|集群测试|

一、集群测试
### --- HDFS 分布式存储初体验
~~~     从linux本地文件系统上传下载文件验证HDFS集群工作正常
~~~     HDFS访问地址:http://hadoop01:50070/

~~~     # 本地hoome目录创建一个文件
[root@hadoop01 ~]# vim test.txt
hello hdfs
~~~     # 创建一个目录

[root@hadoop01 ~]# hdfs dfs -mkdir -p /test/input
~~~     # 上传linxu文件到Hdfs

[root@hadoop01 ~]# hdfs dfs -put /root/test.txt /test/input
~~~     # 从Hdfs下载文件到linux本地

[root@hadoop01 ~]# hdfs dfs -get /test/input/test.txt
### --- MapReduce 分布式计算初体验

~~~     # 在HDFS文件系统根目录下面创建一个wcinput文件夹
[root@hadoop01 ~]# hdfs dfs -mkdir /wcinput
~~~     # 在/root/目录下创建一个wc.txt文件(本地文件系统)
[root@hadoop01 ~]# touch wc.txt
~~~     # 编辑wc.txt文件

[root@hadoop01 ~]# vim wc.txt
#在文件中输入如下内容
hadoop mapreduce yarn
hdfs hadoop mapreduce
mapreduce yarn yanqi
yanqi
yanqi
### --- 上传wc.txt到Hdfs目录/wcinput下
[root@hadoop01 ~]# hdfs dfs -put wc.txt /wcinput
 
~~~     # 回到Hadoop目录/opt/yanqi/servers/hadoop-2.9.2
~~~     执行程序
[root@hadoop01 ~]# cd /opt/yanqi/servers/hadoop-2.9.2
[root@hadoop01 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@hadoop01 hadoop-2.9.2]# hdfs dfs -cat /wcoutput/part-r-00000
# 在文件中输入如下内容    1
hadoop  2
hdfs    1
mapreduce   3
yanqi   3
yarn    2
二、查看详细日志:http://hadoop01:8088/cluster

 
 
 
 
 
 
 
 
 

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

 

posted on   yanqi_vip  阅读(8)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示