title: YARN-Cgroups : Failed to initialize container executor in non-secure cluster
body: <p>I am trying to use cgroups with YARN 2.6.0 in non-secure mode. It works
  fine if I use DefaultContainerExecutor. But, I get error when I try to use LinuxContainerExecutor.</p>
  
  <p>Now, when I execute --> $ yarn nodemanager, it fails</p>
  
  <pre><code>ExitCodeException exitCode=24: File /home/hduser2/hadoop/hadoop-2.6.0/etc/hadoop must be owned by root, but is owned by 1001
  
      at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
      at org.apache.hadoop.util.Shell.run(Shell.java:455)
      at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
      at org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor.init(LinuxContainerExecutor.java:181)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:209)
      at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.initAndStartNodeManager(NodeManager.java:462)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.main(NodeManager.java:509)
  15/08/08 23:07:39 INFO nodemanager.ContainerExecutor: 
  15/08/08 23:07:39 INFO service.AbstractService: Service NodeManager failed in state INITED; cause: org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Failed to initialize container executor
  org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Failed to initialize container executor
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:211)
      at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.initAndStartNodeManager(NodeManager.java:462)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.main(NodeManager.java:509)
  Caused by: java.io.IOException: Linux container executor not configured properly (error=24)
      at org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor.init(LinuxContainerExecutor.java:187)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:209)
      ... 3 more
  Caused by: ExitCodeException exitCode=24: File /home/hduser2/hadoop/hadoop-2.6.0/etc/hadoop must be owned by root, but is owned by 1001
  
      at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
      at org.apache.hadoop.util.Shell.run(Shell.java:455)
      at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
      at org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor.init(LinuxContainerExecutor.java:181)
      ... 4 more
  15/08/08 23:07:39 WARN service.AbstractService: When stopping the service NodeManager : java.lang.NullPointerException
  java.lang.NullPointerException
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.stopRecoveryStore(NodeManager.java:161)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceStop(NodeManager.java:273)
      at org.apache.hadoop.service.AbstractService.stop(AbstractService.java:221)
      at org.apache.hadoop.service.ServiceOperations.stop(ServiceOperations.java:52)
      at org.apache.hadoop.service.ServiceOperations.stopQuietly(ServiceOperations.java:80)
      at org.apache.hadoop.service.AbstractService.init(AbstractService.java:171)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.initAndStartNodeManager(NodeManager.java:462)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.main(NodeManager.java:509)
  15/08/08 23:07:39 FATAL nodemanager.NodeManager: Error starting NodeManager
  org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Failed to initialize container executor
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:211)
      at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.initAndStartNodeManager(NodeManager.java:462)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.main(NodeManager.java:509)
  Caused by: java.io.IOException: Linux container executor not configured properly (error=24)
      at org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor.init(LinuxContainerExecutor.java:187)
      at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:209)
      ... 3 more
  Caused by: ExitCodeException exitCode=24: File /home/hduser2/hadoop/hadoop-2.6.0/etc/hadoop must be owned by root, but is owned by 1001
  
      at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
      at org.apache.hadoop.util.Shell.run(Shell.java:455)
      at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
      at org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor.init(LinuxContainerExecutor.java:181)
      ... 4 more
  15/08/08 23:07:39 INFO nodemanager.NodeManager: SHUTDOWN_MSG: 
  </code></pre>
  
  <p>Site specific YARN configuration properties are :</p>
  
  <pre><code>&lt;property&gt;
          &lt;name&gt;yarn.nodemanager.container-executor.class&lt;/name&gt;
          &lt;value&gt;org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor&lt;/value&gt; 
  &lt;/property&gt;
  &lt;property&gt;
          &lt;name&gt;yarn.nodemanager.linux-container-executor.resources-handler.class&lt;/name&gt;
          &lt;value&gt;org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler&lt;/value&gt; 
  &lt;/property&gt;
  &lt;property&gt;
          &lt;name&gt;yarn.nodemanager.linux-container-executor.cgroups.hierarchy&lt;/name&gt;
          &lt;value&gt;/hadoop-yarn&lt;/value&gt; 
  &lt;/property&gt;
  &lt;property&gt;
          &lt;name&gt;yarn.nodemanager.linux-container-executor.cgroups.mount&lt;/name&gt;
          &lt;value&gt;true&lt;/value&gt; 
  &lt;/property&gt;
  &lt;property&gt;
          &lt;name&gt;yarn.nodemanager.linux-container-executor.cgroups.mount-path&lt;/name&gt;
          &lt;value&gt;/cgroup&lt;/value&gt; 
  &lt;/property&gt;
  &lt;property&gt;
          &lt;name&gt;yarn.nodemanager.linux-container-executor.group&lt;/name&gt;
          &lt;value&gt;hadoop&lt;/value&gt; 
  &lt;/property&gt;
  &lt;property&gt;
          &lt;name&gt;yarn.nodemanager.resource.percentage-physical-cpu-limit&lt;/name&gt;
          &lt;value&gt;95&lt;/value&gt;
  &lt;/property&gt;
  
      &lt;property&gt;
              &lt;name&gt;yarn.nodemanager.linux-container-executor.cgroups.strict-resource-usage&lt;/name&gt;
              &lt;value&gt;true&lt;/value&gt;
      &lt;/property&gt;
  </code></pre>
  
  <p>and container-executor.cfg is:</p>
  
  <pre><code>yarn.nodemanager.linux-container-executor.group=hadoop
  min.user.id=1000
  </code></pre>
  
  <p>It would be great if someone can please help me figure out what’s wrong with my setup.</p>