hadoop执行jar包时报 org.apache.hadoop.mapred.InvalidInputException: Input path does not exis

执行hadoop jar MaxTemperature.jar sample.txt output会报Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: hdfs://localhost:9000/user/root/sample.txt 
原因是没有将文件上传到hdfs,因此需要上传到hdfs
上传时,需要在hdfs建好目录 hadoop fs -mkdir  /test/ch02
然后上传hadoop fs -put sample.txt /user/root/test/
最后执行hadoop jar MaxTemperature.jar /user/root/test/sample.txt output
执行完毕后hadoop fs -ls /user/root/output
hadoop fs -cat /user/root/output/part-00000 就可以看到运行结果了
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值