现在的位置: 首页 > 综合 > 正文

hadoop集群模式下hadoop 上传文件 报错could only be replicated to 0 nodes, instead of 1

2013年07月07日 ⁄ 综合 ⁄ 共 783字 ⁄ 字号 评论关闭

 

当执行 #bin/hadoop dfs -copyFromLocal wordCount.txt testWordCount.txt时,报错 ...,could only be replicated to 0 nodes, instead of 1,

在网上查到

http://hi.baidu.com/gkf8605/item/25a302c2e7d3205dbdef69b1《伪分布模式下hadoop 上传文件 报错could only be replicated to 0 nodes, instead of 1》

根据博主的介绍,打开文件系统的开放端口,

如果你的 conf/core-site.xml的配置是:

<configuration>
     <property>
         <name>fs.default.name</name>
         <value>hdfs://machine1:9000/</value>
     </property>
</configuration>

那么你应该将machine1的9000端口打开:

#iptables -I INPUT  -p tcp --dport 9000 -j ACCEPT

然后可以查看
http://machine1:50070/dfshealth.jsp (你应该将500070端口也打开)

这里非常感谢博主,我在这一步就把问题解决了。

 

下面是博主在又报错的情况下给出的解决方法,一并贴过来。

 

再执行,又报别的错:hdfs.DFSClient: Exception in createBlockOutputStream java.net.ConnectException: Connection refused

应该是datanode上的端口不能访问,到datanode上修改iptables:

#iptables -I INPUT  -s machine1 -p tcp  -j ACCEPT

OK 了!

抱歉!评论已关闭.