admin管理员组文章数量:1608623
java代码连接hadoop FileSystem 连接hdfs报错:Connection refused: no further information
确保应用正常启动、JPS该起的进程都要启动的情况下,用java接连hdfs做文件上传报如下错误:
java.ConnectException: Call From USER-20150505FN/192.168.1.115 to www.danpinshop:9000 failed on connection exception: java.ConnectException: Connection refused: no further information; For more details see: http://wiki.apache/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.hadoop.NetUtils.wrapWithMessage(NetUtils.java:783)
at org.apache.hadoop.NetUtils.wrapException(NetUtils.java:730)
at org.apache.hadoop.ipc.Client.call(Client.java:1351)
at org.apache.hadoop.ipc.Client.call(Client.java:1300)
解决办法:
1.可能是权限问题
在hdfs-site.xml文件里添加
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
2.core-site.xml配置的fs.defaultFS,原来配置的hdfs://localhost:9000更改为机器ip。
灵感来自于:
https://www.oschina/question/1399571_246927
本文标签: 报错代码filesystemJavaHadoop
版权声明:本文标题:java代码连接hadoop FileSystem 连接hdfs报错:Connection refused: no further information 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1728548755a1163174.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论