BUG-30575. MapReduce2 Service Check fails after enabling Kerberos with 
permission issue in local filesystem.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a03fb1be
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a03fb1be
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a03fb1be

Branch: refs/heads/2.0-preview
Commit: a03fb1be1ff3780213b56e551337796beb356c51
Parents: 786d780
Author: Yusaku Sako <yus...@hortonworks.com>
Authored: Thu Jan 22 11:50:00 2015 -0800
Committer: Yusaku Sako <yus...@hortonworks.com>
Committed: Thu Jan 22 11:50:00 2015 -0800

----------------------------------------------------------------------
 .../common-services/YARN/2.1.0.2.0/package/scripts/yarn.py      | 5 +++++
 .../src/test/python/stacks/2.0.6/YARN/test_nodemanager.py       | 1 +
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a03fb1be/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
index cf0d211..50d4f11 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
@@ -70,6 +70,11 @@ def yarn(name = None):
               mode=0775
               )
 
+    if params.security_enabled:
+      smokeuser_directories = [os.path.join(dir, 'usercache' ,params.smokeuser)
+                               for dir in params.nm_local_dirs.split(',')]
+      for directory in smokeuser_directories:
+        Execute(format("chown -R {params.smokeuser} {directory}"))
   Directory([params.yarn_pid_dir_prefix, params.yarn_pid_dir, 
params.yarn_log_dir],
             owner=params.yarn_user,
             group=params.user_group,

http://git-wip-us.apache.org/repos/asf/ambari/blob/a03fb1be/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
index 2854399..4a3f32d 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
@@ -438,6 +438,7 @@ class TestNodeManager(RMFTestCase):
                               mode = 0775,
                               recursive_permission=True
                               )
+    self.assertResourceCalled('Execute', 'chown -R ambari-qa 
/hadoop/yarn/local/usercache/ambari-qa')
     self.assertResourceCalled('Directory', '/var/run/hadoop-yarn',
       owner = 'yarn',
       group = 'hadoop',

Reply via email to