eclipse可以连接显示hdfs文件,但运行程序时却提示拒绝连接
报错如下:
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread “main” java.net.ConnectException: Call From master/192.168.131.134 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused ……….
如图:
原因:
hdfs的权限检测机制默认是打开的,未关闭的时候,不能使用eclipse插件对DFS上的文件进行操作,比如上传,删除等。
解决方案: