hadoop - 在多节点集群上运行mapreduce wordcount(Java代码)

标签 hadoop mapreduce

我试图使用eclipse在hadoop多节点群集上运行wordcount java程序(该程序在单节点群集上工作正常,但在多节点上无法运行)。我正在返回关注信息

INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS) 16/04/24 21:30:46 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)


public static void main(String[] args) throws Exception 
 {
Configuration conf = new Configuration();

    Job job = new Job(conf, "wordcount");

job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);

job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);

job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);

FileInputFormat.addInputPath(job, new Path("hdfs://localhost:54310/user/hduser/sam/"));
FileOutputFormat.setOutputPath(job, new Path("hdfs://localhost:54310/user/hduser/wc-output"));

job.waitForCompletion(true);

}

}
*

我认为路径有问题。
我在主端运行此代码

最佳答案

执行命令

hdfs dfs -ls hdfs://localhost:54310/user/hduser/sam/

工作?

关于hadoop - 在多节点集群上运行mapreduce wordcount(Java代码),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36822166/

相关文章:

java - Zookeeper示例-分布式数学计算

java - Reducer,Mapreduce,不显示错误,但不给出所需的输出

java - 自定义二进制输入-Hadoop

hadoop - MapReduce 作业作为用户在/user/yarn/.staging 目录上获得权限错误运行

hadoop - Apache Giraph使用Maven进行编译

java - Hadoop Java 客户端 API 弄乱了我的 fsURI

sql-server - 使用 Tableau 创建仪表板的 Hive 性能?

hadoop - 添加权限以在 Hive 失败时创建计划查询

具有复合键的 Hadoop 困难

algorithm - MapReduce 矩阵乘法复杂度