I figured out the reason: You should set the same value of mapred.local.dir in both mapred-site.xml and taskcontroller.cfg.
plus, due to the following bug, you should set the owner of taskcontroller.cfg and any path from / to taskcontroller to root. Best regards, Yongzhi On Thu, Sep 20, 2012 at 10:28 AM, Yongzhi Wang <[email protected]> wrote: > Dear All, > > I have difficulty to run any job when the security is enabled in Hadoop 1.0.3 > > I install hadoop with account "ywang:ywang", and I submit job with an > ordinary user account "alice:hadoopuser". > > When I run the wordcount application, I got the following logs in job > tracker. According to the log, it seems the jobToken has been > generated in /tmp/hadoop-ywang/mapred/system/job_201209192235_0001/jobToken, > but the task only find it in > /tmp/hadoop-alice/mapred/local/taskTracker/alice/jobcache/job_201209192235_0001/jobToken. > Therefore no token is found. > > //////////////////////////////////////////////////////////////////////////LOG////////////////////////////////////////////////////////////////// > ...... > 2012-09-19 22:36:47,573 WARN org.apache.hadoop.security.token.Token: > No TokenRenewer defined for token kind HDFS_DELEGATION_TOKEN > 2012-09-19 22:36:47,573 INFO org.apache.hadoop.mapred.JobInProgress: > job_201209192235_0001: nMaps=5 nReduces=1 max=-1 > 2012-09-19 22:36:47,579 INFO org.apache.hadoop.mapred.JobTracker: > Initializing job_201209192235_0001 > 2012-09-19 22:36:47,579 INFO org.apache.hadoop.mapred.JobInProgress: > Initializing job_201209192235_0001 > 2012-09-19 22:36:47,599 INFO org.apache.hadoop.mapred.JobTracker: Job > job_201209192235_0001 added successfully for user 'alice' to queue > 'default' > 2012-09-19 22:36:47,601 INFO org.apache.hadoop.mapred.AuditLogger: > USER=alice IP=172.16.119.151 OPERATION=SUBMIT_JOB > TARGET=job_201209192235_0001 RESULT=SUCCESS > 2012-09-19 22:36:47,937 INFO org.apache.hadoop.mapred.JobInProgress: > jobToken generated and stored with users keys in > /tmp/hadoop-ywang/mapred/system/job_201209192235_0001/jobToken > ...... > 2012-09-19 22:36:47,963 INFO org.apache.hadoop.mapred.JobInProgress: > Job job_201209192235_0001 initialized successfully with 5 map tasks > and 1 reduce tasks. > 2012-09-19 22:36:48,851 INFO org.apache.hadoop.mapred.JobTracker: > Adding task (JOB_SETUP) 'attempt_201209192235_0001_m_000006_0' to tip > task_201209192235_0001_m_000006, for tracker > 'xxx.xxx.xxx.xxx.xxx:localhost/127.0.0.1:60723' > 2012-09-19 22:36:51,905 INFO org.apache.hadoop.mapred.TaskInProgress: > Error from attempt_201209192235_0001_m_000006_0: Error initializing > attempt_201209192235_0001_m_000006_0: > java.io.IOException: Job initialization failed (1) with output: > at > org.apache.hadoop.mapred.LinuxTaskController.initializeJob(LinuxTaskController.java:193) > at org.apache.hadoop.mapred.TaskTracker$4.run(TaskTracker.java:1228) > at java.security.AccessController.doPrivileged(Native Method) > at javax.security.auth.Subject.doAs(Subject.java:396) > at > org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) > at > org.apache.hadoop.mapred.TaskTracker.initializeJob(TaskTracker.java:1203) > at > org.apache.hadoop.mapred.TaskTracker.localizeJob(TaskTracker.java:1118) > at org.apache.hadoop.mapred.TaskTracker$5.run(TaskTracker.java:2430) > at java.lang.Thread.run(Thread.java:619) > Caused by: org.apache.hadoop.util.Shell$ExitCodeException: 12/09/19 > 22:36:49 INFO fs.LocalDirAllocator$AllocatorPerContext: > /tmp/hadoop-alice/mapred/local/taskTracker/alice/jobcache/job_201209192235_0001/jobToken > Exception in thread "main" > org.apache.hadoop.util.DiskChecker$DiskErrorException: Could not find > jobcache/job_201209192235_0001/jobToken in any of the configured local > directories > at > org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.getLocalPathToRead(LocalDirAllocator.java:430) > at > org.apache.hadoop.fs.LocalDirAllocator.getLocalPathToRead(LocalDirAllocator.java:160) > at > org.apache.hadoop.mapred.JobLocalizer.findCredentials(JobLocalizer.java:466) > at org.apache.hadoop.mapred.JobLocalizer.main(JobLocalizer.java:511) > > at org.apache.hadoop.util.Shell.runCommand(Shell.java:255) > at org.apache.hadoop.util.Shell.run(Shell.java:182) > at > org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:375) > at > org.apache.hadoop.mapred.LinuxTaskController.initializeJob(LinuxTaskController.java:186) > ... 8 more > > 2012-09-19 22:36:51,906 ERROR org.apache.hadoop.mapred.TaskStatus: > Trying to set finish time for task > attempt_201209192235_0001_m_000006_0 when no start time is set, > stackTrace is : java.lang.Exception > at > org.apache.hadoop.mapred.TaskStatus.setFinishTime(TaskStatus.java:145) > at > org.apache.hadoop.mapred.TaskInProgress.incompleteSubTask(TaskInProgress.java:670) > at > org.apache.hadoop.mapred.JobInProgress.failedTask(JobInProgress.java:2945) > at > org.apache.hadoop.mapred.JobInProgress.updateTaskStatus(JobInProgress.java:1162) > at > org.apache.hadoop.mapred.JobTracker.updateTaskStatuses(JobTracker.java:4739) > at > org.apache.hadoop.mapred.JobTracker.processHeartbeat(JobTracker.java:3683) > at org.apache.hadoop.mapred.JobTracker.heartbeat(JobTracker.java:3378) > at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:563) > at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1388) > at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1384) > at java.security.AccessController.doPrivileged(Native Method) > at javax.security.auth.Subject.doAs(Subject.java:396) > at > org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) > at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1382) > > 2012-09-19 22:36:51,919 INFO org.apache.hadoop.mapred.JobTracker: > Adding task (JOB_SETUP) 'attempt_201209192235_0001_r_000002_0' to tip > task_201209192235_0001_r_000002, for tracker > 'tracker_master.narita.cis.fiu.edu:localhost/127.0.0.1:60723' > 2012-09-19 22:36:51,921 INFO org.apache.hadoop.mapred.JobTracker: > Removing task 'attempt_201209192235_0001_m_000006_0' > 2012-09-19 22:36:54,931 INFO org.apache.hadoop.mapred.TaskInProgress: > Error from attempt_201209192235_0001_r_000002_0: Error initializing > attempt_201209192235_0001_r_000002_0: > java.io.IOException: Job initialization failed (255) with output: > Reading task controller config from > /opt/ywang/hadoop-1.0.3/conf/taskcontroller.cfg > main : command provided 0 > main : user is alice > Good mapred-local-dirs are /tmp/hadoop-ywang/mapred/local > Arguments are alice, /tmp/hadoop-ywang/mapred/local, > job_201209192235_0001, > /tmp/hadoop-ywang/mapred/local/ttprivate/taskTracker/alice/jobcache/job_201209192235_0001/jobToken, > /tmp/hadoop-ywang/mapred/local/ttprivate/taskTracker/alice/jobcache/job_201209192235_0001/job.xml > begin initialize user , /tmp/hadoop-ywang/mapred/local > get local_dir: /tmp/hadoop-ywang/mapred/local > result of open_file_as_task_tracker: 3 > result of open_file_as_task_tracker: 4 > result of get_mapred_local_dirs: /tmp/hadoop-ywang/mapred/local > Can't open > /tmp/hadoop-ywang/mapred/local/taskTracker/alice/jobcache/job_201209192235_0001/jobToken > for output - File exists > exit_code is -1 > > at > org.apache.hadoop.mapred.LinuxTaskController.initializeJob(LinuxTaskController.java:193) > at org.apache.hadoop.mapred.TaskTracker$4.run(TaskTracker.java:1228) > at java.security.AccessController.doPrivileged(Native Method) > at javax.security.auth.Subject.doAs(Subject.java:396) > at > org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) > at > org.apache.hadoop.mapred.TaskTracker.initializeJob(TaskTracker.java:1203) > at > org.apache.hadoop.mapred.TaskTracker.localizeJob(TaskTracker.java:1118) > at org.apache.hadoop.mapred.TaskTracker$5.run(TaskTracker.java:2430) > at java.lang.Thread.run(Thread.java:619) > Caused by: org.apache.hadoop.util.Shell$ExitCodeException: > at org.apache.hadoop.util.Shell.runCommand(Shell.java:255) > at org.apache.hadoop.util.Shell.run(Shell.java:182) > at > org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:375) > at > org.apache.hadoop.mapred.LinuxTaskController.initializeJob(LinuxTaskController.java:186) > ... 8 more > ////////////////////////////////////////////////////////////LOG/////////////////////////////////////////////////////// > > The setting of my taskcontroller.cfg is > > mapred.local.dir=/tmp/hadoop-ywang/mapred/local > #configured value of mapred.local.dir. It can be a list of comma > separated paths. > hadoop.log.dir=/opt/ywang/hadoop-1.0.3/logs > #configured value of hadoop.log.dir. > #mapred.tasktracker.tasks.sleeptime-before-sigkill=10 > #sleep time before sig kill is to be sent to process group after > sigterm is sent. Should be in seconds > mapreduce.tasktracker.group=ywang > #configured value of mapreduce.tasktracker.group. > #banned.users=ywang > #min.user.id=1000 > > The permission setting of taskcontroller.cfg is > -r-------- 1 root ywang 490 2012-09-19 14:56 taskcontroller.cfg > The permission setting of taskcontroller is > ---Sr-s--- 1 root ywang 61308 2012-09-19 20:38 task-controller > > Please let me know if you need more information to diagnose. > > Best regards, > Yongzhi
