第一次在本地运行Java代码,调用hadoop的hdfs的api接口,遇到下面的问题:

1、HADOOP_HOME and hadoop.home.dir are unset

解决办法:在本地安装配置hadoop,并且要配置hadoop的环境变量到path中;

2、java.io.FileNotFoundException: Could not locate Hadoop executable: D:\java\hadoop\hadoop-3.2.0\bin\winutils.exe

解决办法,由于本地是Windows操作系统,因而需要用到winutils.exe文件,下载一个,放到hadoop的binI目录,注意这个文件的版本要跟hadoop匹配;

3、java.net.ConnectException: Call From PC-20180901CTYX/192.168.247.1 to 192.168.64.101:9000 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(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

 

相关文章:

  • 2021-06-18
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-09-28
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2021-09-19
  • 2022-01-28
  • 2021-10-27
  • 2022-01-21
  • 2021-05-02
相关资源
相似解决方案