异常
Exception in thread “main” java.lang.IllegalArgumentException: Pathname /F:/data/wordCount.txt from hdfs://node01:8020/F:/data/wordCount.txt is not a valid DFS filename.

java.lang.IllegalArgumentException: Pathname /F:/data/wordCount.txt from hdfs://node01:8020/F:/data

解决措施

java.lang.IllegalArgumentException: Pathname /F:/data/wordCount.txt from hdfs://node01:8020/F:/data

原因:因为我们在程序中,通常会将代码以打jar包的方式,放到集群中运行,所以会导入hdfs-site.xml和core-site.xml等文件,当我们导入这两个文件的后,再次运行程序时会读取到该文件,因此会访问hdfs存储系统中的目录,因此会报错。

解决方法:将这两个文件名添加后缀.bak,如上图所示,问题就解决了。

相关文章:

  • 2021-06-02
  • 2021-07-20
  • 2021-07-04
  • 2021-11-18
  • 2021-07-22
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
猜你喜欢
  • 2021-11-21
  • 2021-07-29
  • 2021-04-23
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
相关资源
相似解决方案