Repository: ambari Updated Branches: refs/heads/trunk b9ba67531 -> 46abfca2d
AMBARI-5973. Usability: Add checks for THP to the Ambari pre-req check for Linux (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/46abfca2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/46abfca2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/46abfca2 Branch: refs/heads/trunk Commit: 46abfca2ddf45ba3a41af869185e4b29cbe07c3f Parents: b9ba675 Author: Andrew Onishuk <[email protected]> Authored: Mon Jun 2 14:23:46 2014 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Mon Jun 2 14:23:46 2014 +0300 ---------------------------------------------------------------------- .../src/main/python/resource_management/core/system.py | 10 ++++++++++ .../stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/hook.py | 2 +- .../HDP/1.3.2/hooks/before-INSTALL/scripts/params.py | 2 +- .../hooks/before-INSTALL/scripts/shared_initialization.py | 5 +++++ .../stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py | 2 +- .../HDP/2.0.6/hooks/before-INSTALL/scripts/params.py | 1 + .../hooks/before-INSTALL/scripts/shared_initialization.py | 5 +++++ 7 files changed, 24 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/46abfca2/ambari-agent/src/main/python/resource_management/core/system.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/resource_management/core/system.py b/ambari-agent/src/main/python/resource_management/core/system.py index 90a2559..e25ed36 100644 --- a/ambari-agent/src/main/python/resource_management/core/system.py +++ b/ambari-agent/src/main/python/resource_management/core/system.py @@ -69,6 +69,16 @@ class System(object): In case cannot detect --> Fail """ return OSCheck.get_os_version() + + @lazy_property + def os_major_version(self): + """ + Example return value: + "6" for "Centos 6.3" + + In case cannot detect --> Fail + """ + return OSCheck.get_os_major_version() @lazy_property def os_release_name(self): http://git-wip-us.apache.org/repos/asf/ambari/blob/46abfca2/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/hook.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/hook.py index 626b199..bd62959 100644 --- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/hook.py +++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/hook.py @@ -27,8 +27,8 @@ class BeforeConfigureHook(Hook): def hook(self, env): import params - env.set_params(params) + change_thp() install_repos() setup_java() setup_users() http://git-wip-us.apache.org/repos/asf/ambari/blob/46abfca2/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py index e7a0d47..e09b22c 100644 --- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py @@ -124,7 +124,7 @@ if has_ganglia_server: hbase_tmp_dir = config['configurations']['hbase-site']['hbase.tmp.dir'] ignore_groupsusers_create = default("ignore_groupsusers_create", False) - +transparent_huge_pages_file = "/sys/kernel/mm/redhat_transparent_hugepage/enabled" #repo params repo_info = config['hostLevelParams']['repo_info'] http://git-wip-us.apache.org/repos/asf/ambari/blob/46abfca2/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py index 3a0bf93..f6d2a94 100644 --- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py +++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py @@ -196,3 +196,8 @@ def setup_java(): def install_packages(): Package(['unzip']) + +def change_thp(): + import params + if System.get_instance().os_family == "redhat" and System.get_instance().os_major_version == '6' : + Execute(format("echo never > {transparent_huge_pages_file}")) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/46abfca2/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py index 6904e9d..5ce7304 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py @@ -26,8 +26,8 @@ class BeforeConfigureHook(Hook): def hook(self, env): import params - env.set_params(params) + change_thp() install_repos() install_packages() setup_java() http://git-wip-us.apache.org/repos/asf/ambari/blob/46abfca2/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py index f55bc2d..17e7c6b 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py @@ -101,6 +101,7 @@ jce_policy_zip = default("/hostLevelParams/jce_name", None) # None when jdk is a jce_location = config['hostLevelParams']['jdk_location'] jdk_location = config['hostLevelParams']['jdk_location'] ignore_groupsusers_create = default("ignore_groupsusers_create", False) +transparent_huge_pages_file = "/sys/kernel/mm/redhat_transparent_hugepage/enabled" #repo params repo_info = config['hostLevelParams']['repo_info'] http://git-wip-us.apache.org/repos/asf/ambari/blob/46abfca2/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py index a1196a8..6f75d6a 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py @@ -218,3 +218,8 @@ def setup_java(): def install_packages(): Package(['unzip', 'curl']) + +def change_thp(): + import params + if System.get_instance().os_family == "redhat" and System.get_instance().os_major_version == '6' : + Execute(format("echo never > {transparent_huge_pages_file}"))
