Updated Branches: refs/heads/trunk 5317b35d0 -> 9c0da685f
AMBARI-3071. Ambari handles limts incorrectly for non-default users (Vitaly Brodetskyi via dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/9c0da685 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/9c0da685 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/9c0da685 Branch: refs/heads/trunk Commit: 9c0da685fb7e7391bf0b636858cdf2719c11e83b Parents: 5317b35 Author: Lisnichenko Dmitro <[email protected]> Authored: Mon Sep 2 23:19:37 2013 +0300 Committer: Lisnichenko Dmitro <[email protected]> Committed: Mon Sep 2 23:21:13 2013 +0300 ---------------------------------------------------------------------- .../puppet/modules/hdp-hadoop/manifests/init.pp | 9 +++++++++ .../modules/hdp-hadoop/templates/hdfs.conf.erb | 17 +++++++++++++++++ .../main/puppet/modules/hdp-yarn/manifests/init.pp | 10 +++++++++- .../hdp-yarn/manifests/mapreducev2_client.pp | 8 ++++++++ .../modules/hdp-yarn/manifests/nodemanager.pp | 8 ++++++++ .../modules/hdp-yarn/manifests/resourcemanager.pp | 10 +++++++++- .../modules/hdp-yarn/templates/mapreduce.conf.erb | 17 +++++++++++++++++ .../modules/hdp-yarn/templates/yarn.conf.erb | 17 +++++++++++++++++ .../main/puppet/modules/hdp/manifests/params.pp | 3 +++ 9 files changed, 97 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp index bed41e9..715e069 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp @@ -241,6 +241,15 @@ class hdp-hadoop( hdp-hadoop::package { 'hadoop':} + #Replace limits config file + hdp::configfile {"${hdp::params::limits_conf_dir}/hdfs.conf": + component => 'hadoop', + owner => 'root', + group => 'root', + require => Hdp-hadoop::Package['hadoop'], + before => Anchor['hdp-hadoop::end'], + mode => 644 + } hdp::directory_recursive_create { $hadoop_config_dir: service_state => $::service_state, http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/ambari-agent/src/main/puppet/modules/hdp-hadoop/templates/hdfs.conf.erb ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-hadoop/templates/hdfs.conf.erb b/ambari-agent/src/main/puppet/modules/hdp-hadoop/templates/hdfs.conf.erb new file mode 100644 index 0000000..b2c3179 --- /dev/null +++ b/ambari-agent/src/main/puppet/modules/hdp-hadoop/templates/hdfs.conf.erb @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +<%=scope.function_hdp_template_var("hdfs_user")%> - nofile 32768 +<%=scope.function_hdp_template_var("hdfs_user")%> - nproc 65536 http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/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 6140054..4615018 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 @@ -28,6 +28,14 @@ class hdp-yarn::initialize() ##Process package hdp-yarn::package{'yarn-common':} + #Replace limits config file + hdp::configfile {"${hdp::params::limits_conf_dir}/yarn.conf": + component => 'yarn', + owner => 'root', + group => 'root', + mode => 644 + } + # Create users hdp::user { 'yarn_mapred_user': user_name => $mapred_user @@ -44,7 +52,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'] -> + anchor{ 'hdp-yarn::initialize::begin': } Hdp::Package['yarn-common'] -> Hdp::Configfile ["${hdp::params::limits_conf_dir}/yarn.conf"] -> Hdp::User<|title == 'yarn_hdfs_user' or title == 'yarn_mapred_user' or title == 'yarn_yarn_user'|> -> Hdp-yarn::Generate_common_configs['yarn-common-configs'] -> anchor{ 'hdp-yarn::initialize::end': } } http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/mapreducev2_client.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/mapreducev2_client.pp b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/mapreducev2_client.pp index 7f81a8e..2cf607d 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/mapreducev2_client.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/mapreducev2_client.pp @@ -31,5 +31,13 @@ class hdp-yarn::mapreducev2_client( hdp-yarn::package{'hadoop-mapreduce-client':} + hdp::configfile {"${hdp::params::limits_conf_dir}/mapreduce.conf": + component => 'yarn', + owner => 'root', + group => 'root', + mode => 644, + require => Hdp-yarn::Package['hadoop-mapreduce-client'] + } + } } http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/nodemanager.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/nodemanager.pp b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/nodemanager.pp index 5976730..398b50c 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/nodemanager.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/nodemanager.pp @@ -36,6 +36,14 @@ class hdp-yarn::nodemanager( ##Process package hdp-yarn::package{'yarn-nodemanager':} + hdp::configfile {"${hdp::params::limits_conf_dir}/mapreduce.conf": + component => 'yarn', + owner => 'root', + group => 'root', + mode => 644, + require => Hdp-yarn::Package['yarn-nodemanager'] + } + } elsif ($service_state in ['running','stopped']) { include hdp-yarn::initialize http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/resourcemanager.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/resourcemanager.pp b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/resourcemanager.pp index fc1ec9f..2ecf442 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/resourcemanager.pp +++ b/ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/resourcemanager.pp @@ -33,6 +33,14 @@ class hdp-yarn::resourcemanager( ##Process package hdp-yarn::package{'yarn-resourcemanager':} + hdp::configfile {"${hdp::params::limits_conf_dir}/mapreduce.conf": + component => 'yarn', + owner => 'root', + group => 'root', + mode => 644, + require => Hdp-yarn::Package['yarn-resourcemanager'] + } + } elsif ($service_state in ['running','stopped']) { include hdp-yarn::initialize @@ -45,4 +53,4 @@ class hdp-yarn::resourcemanager( } else { hdp_fail("TODO not implemented yet: service_state = ${service_state}") } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/ambari-agent/src/main/puppet/modules/hdp-yarn/templates/mapreduce.conf.erb ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-yarn/templates/mapreduce.conf.erb b/ambari-agent/src/main/puppet/modules/hdp-yarn/templates/mapreduce.conf.erb new file mode 100644 index 0000000..222938e --- /dev/null +++ b/ambari-agent/src/main/puppet/modules/hdp-yarn/templates/mapreduce.conf.erb @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +<%=scope.function_hdp_template_var("mapred_user")%> - nofile 32768 +<%=scope.function_hdp_template_var("mapred_user")%> - nproc 65536 http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/ambari-agent/src/main/puppet/modules/hdp-yarn/templates/yarn.conf.erb ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-yarn/templates/yarn.conf.erb b/ambari-agent/src/main/puppet/modules/hdp-yarn/templates/yarn.conf.erb new file mode 100644 index 0000000..bb0c951 --- /dev/null +++ b/ambari-agent/src/main/puppet/modules/hdp-yarn/templates/yarn.conf.erb @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +<%=scope.function_hdp_template_var("yarn_user")%> - nofile 32768 +<%=scope.function_hdp_template_var("yarn_user")%> - nproc 65536 http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9c0da685/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp index d62af04..c70c847 100644 --- a/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp +++ b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp @@ -332,6 +332,9 @@ class hdp::params() $dfs_ha_enabled = false } + # Directory for limits configurations + $limits_conf_dir = "/etc/security/limits.d" + $packages = 'bigtop' if ($packages == 'hdp') { $mapred_smoke_test_script = "/usr/sbin/hadoop-validate-setup.sh"
