org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist:
2016-07-29 10:55
771 查看
已验证
一个Hadoop小程序:将Hello world写入文件中,简要代码:[java]
view plain
copy
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
Job job = new Job(conf,"demo");
job.setJarByClass(HelloWorld.class);
job.setMapperClass(MyMapper.class);
job.setCombinerClass(MyReducer.class);
job.setReducerClass(IntSumReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
FileInputFormat.addInputPath(job,new Path("/anders/passwd"));
FileOutputFormat.setOutputPath(job, new Path("/anders/out1"));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
mapper reducer 不上了……
用eclipse 运行:run on hadoop出现
[java]
view plain
copy
Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/anders/passwd
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:235)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:252)
at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:962)
at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:979)
at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
at cn.sdu.hadoop.HelloWorld.main(HelloWorld.java:58)
就是文件路径不对,google一下
修改代码:
FileInputFormat.addInputPath(job,new Path("hdfs://localhost:9000/anders/passwd"));
FileOutputFormat.setOutputPath(job, new Path("hdfs://localhost:9000/anders/out1"));
这样才能正确,这个路径是根据core-site.xml里面的fs.default.name
这回就可以用eclipse运行了。。。。。
相关文章推荐
- org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist:
- 错误:org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: hdfs://localhost/
- org.apache.hadoop.mapreduce.lib.input.InvalidInputException:input path does not exist:hdfs://10.0.2.
- org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist:
- hadoop异常: org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exi
- "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file
- org.apache.hadoop.mapred.InvalidInputException: Input path does not exist:
- org.apache.hadoop.mapred.InvalidInputException: Input path does not exist问题
- hadoop执行jar包时报 org.apache.hadoop.mapred.InvalidInputException: Input path does not exis
- Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path
- Hadoop分布式集群 EclipseException in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputExce
- hadoop提交作业报错:InvalidAuxServiceException: The auxService:mapreduce_shuffle does not exist
- java.lang.Exception: java.lang.ClassCastException: org.apache.hadoop.mapreduce.lib.input.TaggedInput
- org.apache.hadoop.yarn.exceptions.InvalidAuxServiceException: The auxService: mapreduce_shuffle do
- hadoop机群 运行wordcount出现 Input path does not exist: hdfs://ns1/user/root/a.txt
- 解决使用libhdfs.so连接hdfs出错问题java.lang.ClassNotFoundException: org.apache.hadoop.fs.F
- eclipse编译hadoop错误:Input path does not exist: hdfs://192.168.184.21:9001/user/xxxx/input
- Hbase org.apache.hadoop.mapreduce.Export 错误(PriviledgedActionException File dose not exist)
- java.lang.ClassNotFoundException: org.apache.hadoop.hbase.mapreduce.TableOutputFormat解决办法
- Caused by: org.jbpm.api.JbpmException: resource classpath:jdpm/jbpm.cfg.xml does not exist