CentOS 7下Hadoop完全分布式集群搭建(4)

[hadoop@hadoop-master hadoop-2.7.5]$ sbin/stop-all.sh
This script is Deprecated. Instead use stop-dfs.sh and stop-yarn.sh
Stopping namenodes on [hadoop-master]
hadoop-master: stopping namenode
slave1: stopping datanode
Stopping secondary namenodes [0.0.0.0]
0.0.0.0: stopping secondarynamenode
stopping yarn daemons
stopping resourcemanager
slave1: stopping nodemanager
no proxyserver to stop

2.5.8 创建HDFS

# hdfs dfs -mkdir /user

# hdfs dfs -mkdir  /user/test22

2.5.9 拷贝input文件到HDFS目录下

# hdfs dfs -put etc/hadoop/*.sh  /user/test22/input

查看

# hdfs dfs -ls /user/test22/input

2.5.10 执行hadoop job

统计单词的例子,此时的output是hdfs中的目录,hdfs dfs -ls可查看

# hadoop jar  share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.5.jar wordcount  /user/test22/input  output

确认执行结果

# hdfs dfs -cat output/*

2.5.11 查看错误日志

注:日志在salve1的*.log中而不是在master或*.out中

CentOS 7下Hadoop完全分布式集群搭建

2.6 Q&A

1. hdfs dfs -put 报错如下,解决关闭master&salve防火墙

hdfs.DFSClient: Exception in createBlockOutputStream

java.net.NoRouteToHostException: No route to host

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/fb5e257ae63a43966006ef5aaa499ef0.html