Call From DESKTOP-2UEFCGD/192.168.51.5 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused: no further information; For more details see:

遇到这个问题是:

public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
Configuration conf = new Configuration();
Job job = new Job(conf, "OneSort");
job.setJarByClass(OneSort.class);
job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);
job.setOutputKeyClass(IntWritable.class);
job.setOutputValueClass(Text.class);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
Path in = new Path("hdfs://node01:8020/kkb/data/mapreduce3/in/goods_visit1.txt");
Path out = new Path("hdfs://node01:8020/kkb/data/mapreduce3/out");
FileInputFormat.addInputPath(job, in);
FileOutputFormat.setOutputPath(job, out);
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
Path in = new Path("hdfs://node01:8020/kkb/data/mapreduce3/in/goods_visit1.txt");
    Path out = new Path("hdfs://node01:8020/kkb/data/mapreduce3/out");

主要是:

hdfs://node01:8020/kkb/data/mapreduce3/in/goods_visit1.txt

node01:8020:写的是hdfs的,可以看一下:

 

 

 

 

后面这些是文件的路径:/kkb/data/mapreduce3/in/goods_visit1.txt:

 

posted @ 2021-11-25 00:17  yasai  阅读(494)  评论(0编辑  收藏  举报