Просмотр исходного кода

AMBARI-2889. yarn user not created on a host with ambari-server and ambari-agent. (Vitaly Brodetskyi via swagle)

Siddharth Wagle 11 лет назад
Родитель
Сommit
90395eee09

+ 1 - 7
ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/init.pp

@@ -21,17 +21,11 @@
 
 class hdp-yarn::initialize()
 {
-  $yarn_user = $hdp-yarn::params::yarn_user
   $mapred_user = $hdp-yarn::params::mapred_user
   
   ##Process package
   hdp-yarn::package{'yarn-common':}
   
-  # Create yarn user
-  hdp::user { 'yarn_user':
-    user_name => $yarn_user
-  }
-  
   # Create mapred user
   hdp::user { 'mapred_user':
      user_name => $mapred_user
@@ -40,7 +34,7 @@ class hdp-yarn::initialize()
   #Generate common configs
   hdp-yarn::generate_common_configs{'yarn-common-configs':}
   
-  anchor{ 'hdp-yarn::initialize::begin': } Hdp::Package['yarn-common'] -> Hdp::User['yarn_user'] -> Hdp-yarn::Generate_common_configs['yarn-common-configs'] -> anchor{ 'hdp-yarn::initialize::end': }
+  anchor{ 'hdp-yarn::initialize::begin': } Hdp::Package['yarn-common'] -> Hdp-yarn::Generate_common_configs['yarn-common-configs'] -> anchor{ 'hdp-yarn::initialize::end': }
 }
 
 define hdp-yarn::generate_common_configs() {

+ 8 - 0
ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp

@@ -195,6 +195,14 @@ class hdp(
       Anchor['hdp::begin'] -> Hdp::Group['hdp_user_group'] -> Hdp::User['hive_user'] -> Anchor['hdp::end']  
     }
 
+    if ($hdp::params::rm_host != "") {
+      hdp::user { 'yarn_user':
+        user_name => $hdp::params::yarn_user
+      }
+      
+      Anchor['hdp::begin'] -> Hdp::Group['hdp_user_group'] -> Hdp::User['yarn_user'] -> Anchor['hdp::end']
+    }
+
 }
 
 class hdp::pre_install_pkgs