Exception while submitting a mapreduce job from remote system(从远程系统提交 mapreduce 作业时出现异常)
问题描述
我在从远程系统提交 mapreduce 作业时遇到异常
I got an exception while submitting a mapreduce job from remote system
13/10/28 18:49:52 错误 security.UserGroupInformation: PriviledgedActionException as:root cause:org.apache.hadoop.mapred.InvalidInputException: 输入路径不存在: file:/F:/Workspaces/Test/Hadoop/测试
13/10/28 18:49:52 ERROR security.UserGroupInformation: PriviledgedActionException as:root cause:org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/F:/Workspaces/Test/Hadoop/test
我的 hadoop 和 mapreduce 环境是在 linux 机器上配置的.我从本地 Windows PC 提交 wordcount 作业,如下所示:
My hadoop and mapreduce envirnment is configured on a linux machine. I submit the wordcount job from a local Windows PC as follows:
public static void main(String[] args) throws Exception {
    UserGroupInformation ugi = UserGroupInformation.createRemoteUser("root");
    try {
        ugi.doAs(new PrivilegedExceptionAction<Void>() {
            public Void run() throws Exception {
                JobConf conf = new JobConf(MapReduce.class);
                conf.set("mapred.job.name", "MyApp");
                conf.set("mapred.job.tracker", "192.168.1.149:9001");
                conf.set("fs.default.name","hdfs://192.168.1.149:9000");
                conf.set("hadoop.job.ugi", "root");
                conf.setOutputKeyClass(Text.class);
                conf.setOutputValueClass(IntWritable.class);
                conf.setMapperClass(Map.class);
                conf.setCombinerClass(Reduce.class);
                conf.setReducerClass(Reduce.class);
                conf.setInputFormat(TextInputFormat.class);
                conf.setOutputFormat(TextOutputFormat.class);
                FileInputFormat.setInputPaths(conf, new Path("test"));
                FileOutputFormat.setOutputPath(conf, new Path("test"));
                JobClient.runJob(conf);
                return null;
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    }
}
其中 192.168.1.149 是 hadoop 配置的 linux pc.我在那里启动了 hadoop、mapreduce 服务.此外,test 目录也是使用相同的 java API 创建的,它可以正常工作.但 mapreduce 不是.
where 192.168.1.149 is the hadoop configured linux pc. I started hadoop, mapreduce services there. Also test directory was also created with same java API, it worked. But mapreduce not.
**请帮忙.. **
推荐答案
其实是我的配置错误:
我错过了 mapred-site.xml 中的 mapred.local.dir 属性
I missed mapred.local.dir property in mapred-site.xml
 
                        这篇关于从远程系统提交 mapreduce 作业时出现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从远程系统提交 mapreduce 作业时出现异常
				
        
 
            
        - Jersey REST 客户端:发布多部分数据 2022-01-01
 - 如何使用WebFilter实现授权头检查 2022-01-01
 - 将log4j 1.2配置转换为log4j 2配置 2022-01-01
 - Eclipse 插件更新错误日志在哪里? 2022-01-01
 - Java包名称中单词分隔符的约定是什么? 2022-01-01
 - value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
 - Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
 - Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
 - C++ 和 Java 进程之间的共享内存 2022-01-01
 - 从 finally 块返回时 Java 的奇怪行为 2022-01-01
 
						
						
						
						
						