在虚拟机部署hadoop的HDFS系统,在centos系统中敲各种操作命令,对文件读取、上传、删除等都没什么问题。但用JAVA写了代码去操作HDFS文件时,出现奇怪的现象:
代码写是写到获取fileSystem对象:
Configuration configuration=new Configuration(); FileSystem fileSystem=FileSystem.get(configuration);
报了以下异常现象:
Exception in thread "main" java.net.ConnectException: Call From DESKTOP-1A7JSVH/192.168.139.1 to hadoop.node.master:8020 failed on connection exception: java.net.ConnectException: Connection refused: no further information; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0