问题的基本现象:
在测试Hadoop的分布式环境搭建时,在namenode启动时信息如下:
引用
[@linuxidc hadoop]$ bin/start-all.sh
starting namenode, logging to /home/linuxidc/hadoop/bin/../logs/hadoop-linuxidc-namenode-shnap.out
192.168.8.148: starting datanode, logging to /home/linuxidc/hadoop/bin/../logs/hadoop-linuxidc-datanode-linuxidc-VirtualBox.out
192.168.8.150: starting secondarynamenode, logging to /home/linuxidc/hadoop/bin/../logs/hadoop-linuxidc-secondarynamenode-shnap.out
starting jobtracker, logging to /home/linuxidc/hadoop/bin/../logs/hadoop-linuxidc-jobtracker-shnap.out
192.168.8.148: starting tasktracker, logging to /home/linuxidc/hadoop/bin/../logs/hadoop-linuxidc-tasktracker-linuxidc-VirtualBox.out
[@linuxidc hadoop]$ jps
30045 JobTracker
29973 SecondaryNameNode
29813 NameNode
30136 Jps
从上述信息可见namenode中的进程信息正常
在datanode查看的信息如下:
引用
@linuxidc-VirtualBox:~/hadoop$ jps
15934 TaskTracker
15978 Jps
从上述信息可见datanode中的进程就不正常了,明显少了DataNode
解决办法如下:
先检查conf/masters 和conf/slaves文件,确保配置没错。
然后把所有节点的hadoop.tmp.dir指定的文件夹下的内容全部删掉
重新在master设备上执行启动程序: $ bin/hadoop namenode -format $ bin/start-all.sh
再在datanode查看的信息就正常了如下:
引用
@linuxidc-VirtualBox:~/hadoop$ jps
16467 Jps
16289 DataNode
16429 TaskTracker