以另一个用户身份运行Hadoop作业

时间:2013-11-05 13:52:13

标签: hadoop mapreduce

我正在运行Hadoop 1.2.1,它是为用户hadoopuser配置的。我正试图从我的Windows机器上提交一份工作,这是一个问题,因为在我的Windows机器上我不再是一个hadoopuser,所以我得到了:

security.UserGroupInformation: PriviledgedActionException

有没有办法可以从我的Windows机器上为hadoop用户提交作业?

更新:堆栈跟踪:

 ERROR security.UserGroupInformation: PriviledgedActionException as:windowsuser cause:org.apache.hadoop.security.AccessControlException: org.apache.hadoop.security.AccessControlException: Permission denied: user=windowsuser, access=WRITE, inode="mapred":hadoopuser:supergroup:rwxr-xr-x
org.apache.hadoop.security.AccessControlException: org.apache.hadoop.security.AccessControlException: Permission denied: user=windowsuser, access=WRITE, inode="mapred":hadoopuser:supergroup:rwxr-xr-x
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at org.apache.hadoop.ipc.RemoteException.instantiateException(RemoteException.java:95)
    at org.apache.hadoop.ipc.RemoteException.unwrapRemoteException(RemoteException.java:57)
    at org.apache.hadoop.hdfs.DFSClient.mkdirs(DFSClient.java:1459)
    at org.apache.hadoop.hdfs.DistributedFileSystem.mkdirs(DistributedFileSystem.java:362)
    at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:126)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:942)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
    at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:910)
    at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1353)
    at com.rf.mapreduce.WordCount.main(WordCount.java:40)

1 个答案:

答案 0 :(得分:0)

您可以发布整个错误日志吗?

我认为您的问题是因为您在更改用户时没有清理输出文件。

尝试:

hdfs dfs -rmr /home/hadoop/your-output-dir

路径取决于您的HDFS实施。