hadoop使用过程中的一些问题

本文档介绍了Hadoop使用过程中的几个实用技巧,包括如何查看文件在HDFS上的block分布、解决跨平台作业提交失败的问题、定位MapReduce作业日志及设置Hadoop客户端用户名的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 如何知道一个文件在HDFS上block的分布情况
[url]http://stackoverflow.com/questions/6372060/how-to-track-which-data-block-is-in-which-data-node-in-hadoop[/url]

2 用windows 电脑向linux hadoop集群上提交job失败
org.apache.hadoop.util.Shell$ExitCodeException: /bin/bash: line 0: fg: no job control

这是hadoop的bug https://issues.apache.org/jira/browse/MAPREDUCE-4052
jira上写的在2.4.0已经被fix,我们用的2.5,需要在配置文件中加入

<property>
<description>If enabled, user can submit an application cross-platform
i.e. submit an application from a Windows client to a Linux/Unix server or
vice versa.
</description>
<name>mapreduce.app-submission.cross-platform</name>
<value>false</value>
</property>


3 如何找到各种mapreduce job的日志,方便查看
[url]http://www.iteblog.com/archives/896[/url]

4 如何指定hadoop client的用户名
根据UserGroupInformation的源码分析,可以设置HADOOP_USER_NAME环境变量或者系统属性

//If we don't have a kerberos user and security is disabled, check
//if user is specified in the environment or properties
if (!isSecurityEnabled() && (user == null)) {
String envUser = System.getenv(HADOOP_USER_NAME);
if (envUser == null) {
envUser = System.getProperty(HADOOP_USER_NAME);
}
user = envUser == null ? null : new User(envUser);
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值