我如何处理Hadoop中的java.net.ConnectException?

时间:2015-10-29 08:45:31

标签: hadoop hdfs hadoop2

我试图将一些本地文件复制到HDFS,使用以下脚本:

bin/hadoop fs -copyFromLocal '/home/czy/IdeaProjects/HadoopInAction/FirstHadoop/src/main/resources/crossView.txt' /user/czy

它是这样的:

copyFromLocal: Call From ubuntu/127.0.1.1 to localhost:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

但是当我使用这样的脚本(没有hdfs:// localhost /)时,效果很好:

bin/hadoop fs -copyFromLocal '/home/czy/IdeaProjects/HadoopInAction/FirstHadoop/src/main/resources/crossView.txt' /user/czy

为什么会这样?为什么在将namenode端口配置为9000时收到to localhost:8020 failed

1 个答案:

答案 0 :(得分:0)

检查core-site.xml文件以获取有效参数,服务器和端口名称

检查以下链接..可能有用......

https://datashine.wordpress.com/2014/09/06/java-net-connectexception-connection-refused-for-more-details-see-httpwiki-apache-orghadoopconnectionrefused/