我能够通过使用安全模拟功能解决类似的问题
http://hadoop.apache.org/common/docs/stable/Secure_Impersonation.html
遵循此代码段
UserGroupInformation ugi =
UserGroupInformation.createProxyUser("hduser", UserGroupInformation.getLoginUser());
ugi.doAs(new PrivilegedExceptionAction<Void>() {
public Void run() throws Exception {
Configuration jobconf = new Configuration();
jobconf.set("fs.default.name", "hdfs://server:hdfsport");
jobconf.set("hadoop.job.ugi", "hduser");
jobconf.set("mapred.job.tracker", "server:jobtracker port");
String[] args = new String[] { "data/input", "data/output" };
ToolRunner.run(jobconf, WordCount.class.newInstance(), args);
return null;
}
});
如URL 中core-site.xml
所述,应添加远程(在我的情况下为 Windows 桌面主机)登录用户 ID