Datanodes available: 0 (0 total, 0 dead)

       相信大家在搭建hadoop之后经常会出现Datanodes available: 0 (0 total, 0 dead)的问题,出现这种问题的原因很多,其他原因网上都有介绍。今天讲一讲本人出现的问题点,出现这个问题后首先查看datanode日志文件发现:

WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Problem connecting to server: master/192.168.65.133:9000。

后面从网上搜到的解决方法如下:

I had exactly same problem and when I checked datanodes logs, there were lots of could not connect to master:9000, and when I checked ports on master via netstat -ntlp I had this in output:

tcp 0 0 127.0.1.1:9000 ...

I realized that I should change my master machine name or change master in all configs. I decided to do the first cause it seems much easier. so I modified /etc/hosts and changed 127.0.1.1 master to 127.0.1.1 master-machine and added an entry at the end of the file like this:

192.168.1.1 master

Then I changed master to master-machine in /etc/hostname and restart the machine. The problem was gone.

意思是配置的

<property>
<name>fs.defaultFS</name>
<value>hdfs://master:9000</value>

</property>

中的master不能和主机名相同,否则9000端口会被占用,将主机名修改之后就不会有这个问题了

猜你喜欢

转载自blog.csdn.net/qq_34295546/article/details/79426831
0