1、现象:有一个节点的NodeManager启动不了。
后台报错日志如下:
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Failed to initialize container executor at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:192) at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163) at org.apache.hadoop.yarn.server.nodemanager.NodeManager.initAndStartNodeManager(NodeManager.java:425) at org.apache.hadoop.yarn.server.nodemanager.NodeManager.main(NodeManager.java:472) Caused by: java.io.IOException: Cannot run program "/opt/hadoop-yarn/bin/container-executor": error=13, Permission denied at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) at org.apache.hadoop.util.Shell.runCommand(Shell.java:485) at org.apache.hadoop.util.Shell.run(Shell.java:455) at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:702) at org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor.init(LinuxContainerExecutor.java:169) at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:190) ... 3 more Caused by: java.io.IOException: error=13, Permission denied at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:186) at java.lang.ProcessImpl.start(ProcessImpl.java:130) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028) ... 8 more
2、container-executor的权限如图所示:
3、问题排查过程
yarn后台运行的用户是mr,但是其不在users组中,导致没有权限报错。
解决方法:将mr加到users用户组中即可,为了减小影响使用root用户执行usermod -G users mr即可,此命令修改了mr用户的附属群组。
其他:
有可能是其他权限问题导致,解决方案参见:
https://blog.csdn.net/lsr40/article/details/79554901