ls: Call From slaver1/127.0.0.1 to master:9000 failed on connection exception: java.net.ConnectException: Connection refused;
For more details see:
http://wiki.apache.org/hadoop/ConnectionRefused
在搭建分布式环境的时候,发现在DataNode中使用命令:
hdfs dfs -ls /
报
ls: Call From slaver1/127.0.0.1 to master:9000 failed on connection exception: java.net.ConnectException: Connection refused;
For more details see:
http://wiki.apache.org/hadoop/ConnectionRefused
我们在通过
http://wiki.apache.org/hadoop/ConnectionRefused 网页的最后一句:
None of these are Hadoop problems, they are host, network and firewall configuration issues. As it is your cluster,
only you can find out and track down the problem.
了解到,如果你的所有配置都是正确的,那么这个问题只能是host,network,firewall.
在帮助文档中,我看到有这么一句话:
Check that there isn't an entry for your hostname mapped to 127.0.0.1 or 127.0.1.1 in /etc/hosts (Ubuntu is notorious for this)
于是我打开master中的hosts文件,查看是否有
127.0.0.1
还真的存在这么个东西,于是我将这行给注释掉
然后将hdfs环境重启,再次执行,发现成功了。。。
这个是master节点的信息:
这个是slaver1节点的信息:
最后,送大家文档最后的一句话:
As it is your cluster,
only you can find out and track down the problem.
大家共勉!