Azure HDInsight链式Mapreduce:输入路径不存在

问题描述 投票:0回答:1

因此,我的map reduce功能可以在本地VM上正常运行,但是在Azure上却出现Input path not found错误。我有两组映射器和缩减器函数,第一个缩减器的输出进入一个临时文件夹,该文件夹是第二个映射器的输入。

    FileInputFormat.addInputPath(job, new Path(args[0]));

    FileSystem.get(conf).delete(new Path("file:///tmp/inter/"),true);
    FileOutputFormat.setOutputPath(job, new Path("file:///tmp/inter/"));
    boolean complete = job.waitForCompletion(true);

    Job job2 = Job.getInstance(conf, "Q4a");
    job2.setJarByClass(Q4a.class);
    job2.setMapperClass(TokenizerMapper2.class);
    job2.setCombinerClass(CountReducer2.class);
    job2.setReducerClass(CountReducer2.class);
    job2.setOutputKeyClass(Text.class);
    job2.setOutputValueClass(Text.class);

//    FileInputFormat.addInputPath(job2, new Path("file:///tmp/inter/part*"));
    FileInputFormat.addInputPath(job2, new Path("file:///tmp/inter/"));
    FileOutputFormat.setOutputPath(job2, new Path(args[1]));
    System.exit(job2.waitForCompletion(true) ? 0 : 1);

enter image description here

第一个映射器和化简器完全执行,然后引发错误。第58行是粘贴代码中的最后一行,但是我相信错误是来自临时输入路径的?我需要在Azure中以其他方式引用临时文件吗?非常感谢您的帮助,谢谢。

azure hadoop mapreduce cluster-computing hdinsight
1个回答
0
投票

好,我刚刚解决了这个问题。看起来HDInsight不支持我指定的文件夹结构。我将路径更改为简单的“输出”,而不是“ file:/// tmp / inter”,它有效。

© www.soinside.com 2019 - 2024. All rights reserved.