Updated Branches: refs/heads/trunk 06d53ed97 -> 63d10763b
AMBARI-2891. hadoop-env.sh and core-site are missing on hosts that have only yarn components deployed (also AMBARI-2892 and AMBARI-2893). (smohanty) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/63d10763 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/63d10763 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/63d10763 Branch: refs/heads/trunk Commit: 63d10763b637361d2548af963b159fdd0367570f Parents: 06d53ed Author: Sumit Mohanty <[email protected]> Authored: Wed Aug 14 10:44:28 2013 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Wed Aug 14 10:44:28 2013 -0700 ---------------------------------------------------------------------- .../puppet/modules/hdp-yarn/manifests/init.pp | 59 +++++++++++++++++--- .../modules/hdp-yarn/manifests/service.pp | 5 -- 2 files changed, 52 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/63d10763/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/init.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/init.pp b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/init.pp index 7b16d8f..19b3c12 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/init.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/init.pp @@ -22,19 +22,31 @@ class hdp-yarn::initialize() { $mapred_user = $hdp-yarn::params::mapred_user - + $hdfs_user = $hdp::params::hdfs_user + $yarn_user = $hdp::params::yarn_user + ##Process package hdp-yarn::package{'yarn-common':} - # Create mapred user + # Create users hdp::user { 'mapred_user': user_name => $mapred_user } - + + hdp::user { 'hdfs_user': + user_name => $hdfs_user + } + + hdp::user { 'yarn_user': + user_name => $yarn_user + } + #Generate common configs hdp-yarn::generate_common_configs{'yarn-common-configs':} - anchor{ 'hdp-yarn::initialize::begin': } Hdp::Package['yarn-common'] -> Hdp-yarn::Generate_common_configs['yarn-common-configs'] -> anchor{ 'hdp-yarn::initialize::end': } + anchor{ 'hdp-yarn::initialize::begin': } Hdp::Package['yarn-common'] -> + Hdp::User<|title == $hdfs_user or title == $mapred_user or title == $yarn_user|> -> + Hdp-yarn::Generate_common_configs['yarn-common-configs'] -> anchor{ 'hdp-yarn::initialize::end': } } define hdp-yarn::generate_common_configs() { @@ -42,6 +54,24 @@ define hdp-yarn::generate_common_configs() { $yarn_config_dir = $hdp-yarn::params::conf_dir # Generate configs + if has_key($::configuration, 'core-site') { + configgenerator::configfile{'core-site': + modulespath => $yarn_config_dir, + filename => 'core-site.xml', + module => 'hdp-hadoop', + configuration => $::configuration['core-site'], + owner => $hdp::params::hdfs_user, + group => $hdp::params::user_group, + mode => 644 + } + } else { # Manually overriding ownership of file installed by hadoop package + file { "${yarn_config_dir}/core-site.xml": + owner => $hdp::params::hdfs_user, + group => $hdp::params::user_group, + mode => 644 + } + } + if has_key($::configuration, 'mapred-site') { configgenerator::configfile{'mapred-site': modulespath => $yarn_config_dir, @@ -49,11 +79,13 @@ define hdp-yarn::generate_common_configs() { module => 'hdp-yarn', configuration => $::configuration['mapred-site'], owner => $hdp-yarn::params::yarn_user, + group => $hdp::params::user_group, mode => 644 } } else { # Manually overriding ownership of file installed by hadoop package file { "${yarn_config_dir}/mapred-site.xml": owner => $hdp-yarn::params::yarn_user, + group => $hdp::params::user_group, mode => 644 } } @@ -65,11 +97,13 @@ define hdp-yarn::generate_common_configs() { module => 'hdp-yarn', configuration => $::configuration['yarn-site'], owner => $hdp-yarn::params::yarn_user, + group => $hdp::params::user_group, mode => 644 } } else { # Manually overriding ownership of file installed by hadoop package file { "${yarn_config_dir}/yarn-site.xml": owner => $hdp-yarn::params::yarn_user, + group => $hdp::params::user_group, mode => 644 } } @@ -81,20 +115,31 @@ define hdp-yarn::generate_common_configs() { module => 'hdp-yarn', configuration => $::configuration['capacity-scheduler'], owner => $hdp-yarn::params::yarn_user, + group => $hdp::params::user_group, mode => 644 } } else { # Manually overriding ownership of file installed by hadoop package file { "${yarn_config_dir}/capacity-scheduler.xml": owner => $hdp-yarn::params::yarn_user, + group => $hdp::params::user_group, mode => 644 } } hdp::configfile {"${yarn_config_dir}/yarn-env.sh": - component => 'yarn', - owner => $hdp-yarn::params::yarn_user, - mode => 755 + component => 'yarn', + owner => $hdp-yarn::params::yarn_user, + group => $hdp::params::user_group, + mode => 755 + } + + hdp::configfile { "${yarn_config_dir}/hadoop-env.sh": + mode => 755, + owner => $hdp::params::hdfs_user, + group => $hdp::params::user_group, + component => 'hadoop' } + if ($hdp::params::security_enabled == true) { $container_executor = "${hdp::params::yarn_container_bin}/container-executor" file { $container_executor: http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/63d10763/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/service.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/service.pp b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/service.pp index 507e120..ee5d44a 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/service.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/service.pp @@ -45,11 +45,6 @@ define hdp-yarn::service( $cmd = "export HADOOP_LIBEXEC_DIR=${hadoop_libexec_dir} && ${daemon} --config ${hdp-yarn::params::conf_dir}" - - - - - if ($ensure == 'running') { if ($run_as_root == true) { $daemon_cmd = "${cmd} start ${name}"
