请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

删除HDFS目录报错

objc[83630]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java (0x1062c24c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1072ed4e0). One of the two will be used. Which one is undefined.

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.lang.IllegalArgumentException: Wrong FS: hdfs://localhost:19000/output/wc, expected: file:///


正在回答 回答被采纳积分+3

1回答

Michael_PK 2018-03-02 17:11:14

看最后一句:你希望操作的是HDFS,但是实际是本地文件。你提供的信息看不到你干了啥

0 回复 有任何疑惑可以回复我~
  • 提问者 hwbaker #1
    我在本地环境执行wordcount报错,报错定位到HDFS“清理已存在的输出目录”。网上找了下解决方案,有网友提供解决方法:
    FileSystem fileSystem = FileSystem.get(configuration);
    改为
    FileSystem fileSystem = outputPath.getFileSystem(configuration);
    
    这样改在本地IDEA运行,就不会报错了。请问这是为什么啊?
    回复 有任何疑惑可以回复我~ 2018-03-02 18:12:31
  • Michael_PK 回复 提问者 hwbaker #2
    本地环境你得写全HDFS路径,否则就是本地文件系统
    回复 有任何疑惑可以回复我~ 2018-03-02 18:13:42
  • 提问者 hwbaker 回复 Michael_PK #3
    hdfs://localhost:19000/input/wc/hello.txt hdfs://localhost:19000/output/wc
    这两个分别是输入文件和输出目录
    回复 有任何疑惑可以回复我~ 2018-03-02 18:15:49
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信