You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2016/02/19 22:37:15 UTC
ambari git commit: AMBARI-15083: Add Stack Advisor validations for
hawq_global_rm_type property in HAWQ (bhuvnesh2703 via jaoki)
Repository: ambari
Updated Branches:
refs/heads/trunk dccacb952 -> 32173ff17
AMBARI-15083: Add Stack Advisor validations for hawq_global_rm_type property in HAWQ (bhuvnesh2703 via jaoki)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/32173ff1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/32173ff1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/32173ff1
Branch: refs/heads/trunk
Commit: 32173ff17642b8cdca6f0fdd5318683b633bb681
Parents: dccacb9
Author: Jun Aoki <ja...@apache.org>
Authored: Fri Feb 19 13:37:08 2016 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Fri Feb 19 13:37:08 2016 -0800
----------------------------------------------------------------------
.../stacks/HDP/2.3/services/stack_advisor.py | 32 +++++++-------
.../stacks/2.3/common/test_stack_advisor.py | 46 ++++++++++++++++++++
2 files changed, 62 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/32173ff1/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index b354378..34e4cfa 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -943,31 +943,31 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
"HAWQ Master or Standby Master cannot use the port 5432 when installed on the same host as the Ambari Server. Ambari Postgres DB uses the same port. Please choose a different value (e.g. 10432)")})
# 2. Check if any data directories are pointing to root dir '/'
- prop_name = 'hawq_master_directory'
- display_name = 'HAWQ Master directory'
- self.validateIfRootDir (properties, validationItems, prop_name, display_name)
-
- prop_name = 'hawq_master_temp_directory'
- display_name = 'HAWQ Master temp directory'
- self.validateIfRootDir (properties, validationItems, prop_name, display_name)
-
- prop_name = 'hawq_segment_directory'
- display_name = 'HAWQ Segment directory'
- self.validateIfRootDir (properties, validationItems, prop_name, display_name)
-
- prop_name = 'hawq_segment_temp_directory'
- display_name = 'HAWQ Segment temp directory'
- self.validateIfRootDir (properties, validationItems, prop_name, display_name)
+ directories = {
+ 'hawq_master_directory': 'HAWQ Master directory',
+ 'hawq_master_temp_directory': 'HAWQ Master temp directory',
+ 'hawq_segment_directory': 'HAWQ Segment directory',
+ 'hawq_segment_temp_directory': 'HAWQ Segment temp directory'
+ }
+ for property_name, display_name in directories.iteritems():
+ self.validateIfRootDir(properties, validationItems, property_name, display_name)
# 3. Check YARN RM address properties
+ YARN = "YARN"
servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
- if "YARN" in servicesList and "yarn-site" in configurations:
+ if YARN in servicesList and "yarn-site" in configurations:
yarn_site = getSiteProperties(configurations, "yarn-site")
for hs_prop, ys_prop in self.getHAWQYARNPropertyMapping().items():
if hs_prop in hawq_site and ys_prop in yarn_site and hawq_site[hs_prop] != yarn_site[ys_prop]:
message = "Expected value: {0} (this property should have the same value as the property {1} in yarn-site)".format(yarn_site[ys_prop], ys_prop)
validationItems.append({"config-name": hs_prop, "item": self.getWarnItem(message)})
+ # 4. Check HAWQ Resource Manager type
+ HAWQ_GLOBAL_RM_TYPE = "hawq_global_rm_type"
+ if YARN not in servicesList and HAWQ_GLOBAL_RM_TYPE in hawq_site and hawq_site[HAWQ_GLOBAL_RM_TYPE].upper() == YARN:
+ message = "{0} must be set to none if YARN service is not installed".format(HAWQ_GLOBAL_RM_TYPE)
+ validationItems.append({"config-name": HAWQ_GLOBAL_RM_TYPE, "item": self.getErrorItem(message)})
+
return self.toConfigurationValidationProblems(validationItems, "hawq-site")
http://git-wip-us.apache.org/repos/asf/ambari/blob/32173ff1/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index 545a2b5..03ae6cc 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -1630,6 +1630,7 @@ class TestHDP23StackAdvisor(TestCase):
def test_validateHAWQConfigurations(self):
services = self.load_json("services-hawq-3-hosts.json")
# setup default configuration values
+ # Test hawq_rm_yarn_address and hawq_rm_scheduler_address are set correctly
configurations = services["configurations"]
configurations["hawq-site"] = {"properties": {"hawq_rm_yarn_address": "localhost:8032",
"hawq_rm_yarn_scheduler_address": "localhost:8030"}}
@@ -1664,3 +1665,48 @@ class TestHDP23StackAdvisor(TestCase):
self.assertEqual(len(problems), 2)
self.assertEqual(problems_dict, expected_warnings)
+ # Test hawq_global_rm_type validation
+ services = {
+ "services" : [
+ {
+ "StackServices" : {
+ "service_name" : "HAWQ"
+ },
+ "components": []
+ } ],
+ "configurations":
+ {
+ "hawq-site": {
+ "properties": {
+ "hawq_global_rm_type": "yarn"
+ }
+ }
+ }
+ }
+ properties = services["configurations"]["hawq-site"]["properties"]
+
+ # case 1: hawq_global_rm_type is set as yarn, but YARN service is not installed. Validation error expected.
+ """
+ Validation error expected is as below:
+ [ {
+ "config-type": "hawq-site",
+ "message": "hawq_global_rm_type must be set to none if YARN service is not installed",
+ "type": "configuration",
+ "config-name": "hawq_global_rm_type",
+ "level": "ERROR"
+ } ]
+ """
+ problems = self.stackAdvisor.validateHAWQConfigurations(properties, defaults, services["configurations"], services, hosts)
+ self.assertEqual(len(problems), 1)
+ self.assertEqual(problems[0]["config-type"], "hawq-site")
+ self.assertEqual(problems[0]["message"], "hawq_global_rm_type must be set to none if YARN service is not installed")
+ self.assertEqual(problems[0]["type"], "configuration")
+ self.assertEqual(problems[0]["config-name"], "hawq_global_rm_type")
+ self.assertEqual(problems[0]["level"], "ERROR")
+
+
+ # case 2: hawq_global_rm_type is set as yarn, and YARN service is installed. No validation errors expected.
+ services["services"].append({"StackServices" : {"service_name" : "YARN"}, "components":[]})
+
+ problems = self.stackAdvisor.validateHAWQConfigurations(properties, defaults, services["configurations"], services, hosts)
+ self.assertEqual(len(problems), 0)