You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2018/06/11 12:28:49 UTC

[ambari] branch trunk updated: AMBARI-24072. NN cannot start due do not have permission for creation of the folde (aonishuk)

This is an automated email from the ASF dual-hosted git repository.

aonishuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new fc2537a  AMBARI-24072.  NN cannot start due do not have permission for creation of the folde (aonishuk)
fc2537a is described below

commit fc2537ae8091124ad2d2866f10e0916ae8f10628
Author: Andrew Onishuk <ao...@hortonworks.com>
AuthorDate: Mon Jun 11 14:46:10 2018 +0300

    AMBARI-24072.  NN cannot start due do not have permission for creation of the folde (aonishuk)
---
 .../stack-hooks/before-START/scripts/params.py       |  1 +
 .../before-START/scripts/shared_initialization.py    |  5 +++++
 .../2.0.6/hooks/before-START/test_before_start.py    | 20 ++++++++++++++++++--
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/ambari-server/src/main/resources/stack-hooks/before-START/scripts/params.py b/ambari-server/src/main/resources/stack-hooks/before-START/scripts/params.py
index e3fa476..89fd942 100644
--- a/ambari-server/src/main/resources/stack-hooks/before-START/scripts/params.py
+++ b/ambari-server/src/main/resources/stack-hooks/before-START/scripts/params.py
@@ -195,6 +195,7 @@ if has_namenode or dfs_type == 'HCFS':
   task_log4j_properties_location = os.path.join(hadoop_conf_dir, "task-log4j.properties")
 
 hadoop_pid_dir_prefix = config['configurations']['hadoop-env']['hadoop_pid_dir_prefix']
+hdfs_pid_dir = format("{hadoop_pid_dir_prefix}/{hdfs_user}")
 hdfs_log_dir_prefix = config['configurations']['hadoop-env']['hdfs_log_dir_prefix']
 hbase_tmp_dir = "/tmp/hbase-hbase"
 #db params
diff --git a/ambari-server/src/main/resources/stack-hooks/before-START/scripts/shared_initialization.py b/ambari-server/src/main/resources/stack-hooks/before-START/scripts/shared_initialization.py
index c26265a..5d68275 100644
--- a/ambari-server/src/main/resources/stack-hooks/before-START/scripts/shared_initialization.py
+++ b/ambari-server/src/main/resources/stack-hooks/before-START/scripts/shared_initialization.py
@@ -51,6 +51,11 @@ def setup_hadoop():
               group='root',
               cd_access='a',
       )
+      Directory(params.hdfs_pid_dir,
+              owner=params.hdfs_user,
+              cd_access='a',
+      )
+
     Directory(params.hadoop_tmp_dir,
               create_parents = True,
               owner=params.hdfs_user,
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
index 6329ee4..54dd935 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
@@ -55,6 +55,10 @@ class TestHookBeforeStart(RMFTestCase):
                               create_parents = True,
                               cd_access = 'a',
                               )
+    self.assertResourceCalled('Directory', '/var/run/hadoop/hdfs',
+        owner = 'hdfs',
+        cd_access = 'a',
+    )                
     self.assertResourceCalled('Directory', '/tmp/hadoop-hdfs',
                               owner = 'hdfs',
                               create_parents = True,
@@ -136,6 +140,10 @@ class TestHookBeforeStart(RMFTestCase):
                               create_parents = True,
                               cd_access = 'a',
                               )
+    self.assertResourceCalled('Directory', '/var/run/hadoop/hdfs',
+        owner = 'hdfs',
+        cd_access = 'a',
+    )            
     self.assertResourceCalled('Directory', '/tmp/hadoop-hdfs',
                               owner = 'hdfs',
                               create_parents = True,
@@ -222,11 +230,15 @@ class TestHookBeforeStart(RMFTestCase):
                               create_parents = True,
                               cd_access = 'a',
                               )
+    self.assertResourceCalled('Directory', '/var/run/hadoop/hdfs',
+        owner = 'hdfs',
+        cd_access = 'a',
+    )                
     self.assertResourceCalled('Directory', '/tmp/hadoop-hdfs',
                               owner = 'hdfs',
                               create_parents = True,
                               cd_access = 'a',
-                              )
+                              )             
     self.assertResourceCalled('File', '/var/lib/ambari-agent/lib/fast-hdfs-resource.jar',
         content = StaticFile('fast-hdfs-resource.jar'),
         mode = 0644,
@@ -310,11 +322,15 @@ class TestHookBeforeStart(RMFTestCase):
                               create_parents = True,
                               cd_access = 'a',
                               )
+    self.assertResourceCalled('Directory', '/var/run/hadoop/hdfs',
+        owner = 'hdfs',
+        cd_access = 'a',
+    )                                 
     self.assertResourceCalled('Directory', '/tmp/hadoop-hdfs',
                               owner = 'hdfs',
                               create_parents = True,
                               cd_access = 'a',
-                              )
+                              )                       
     self.assertResourceCalled('File', '/var/lib/ambari-agent/lib/fast-hdfs-resource.jar',
         content = StaticFile('fast-hdfs-resource.jar'),
         mode = 0644,

-- 
To stop receiving notification emails like this one, please contact
aonishuk@apache.org.