AMBARI-18837: HAWQ Master fails to start when webhdfs is disabled (mithmatt)
(cherry picked from commit fb1064bd2c7ad7de22a3e7a13a78490be2959ff3) Change-Id: Ifccb4e67f8deb08ecd55b1acbe8818b52ad1c267 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f6e5618d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f6e5618d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f6e5618d Branch: refs/heads/AMBARI-2.4.2.16 Commit: f6e5618d25e241698b839ec19216258677917406 Parents: e98d57e Author: Matt <mmat...@pivotal.io> Authored: Wed Nov 9 13:02:03 2016 -0800 Committer: Matt <mmat...@pivotal.io> Committed: Wed Nov 9 21:15:13 2016 +0000 ---------------------------------------------------------------------- .../common-services/HAWQ/2.0.0/package/scripts/params.py | 6 ++++++ .../src/test/python/common-services/HAWQ/test_hawqmaster.py | 4 ++++ 2 files changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f6e5618d/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py index 440a3e6..e2dbd7b 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py @@ -20,6 +20,8 @@ import functools import hawq_constants from resource_management import Script from resource_management.core.resources.system import File +from resource_management.libraries.functions import conf_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions.default import default from resource_management.libraries.resources.hdfs_resource import HdfsResource from resource_management.libraries.resources.xml_config import XmlConfig @@ -60,6 +62,8 @@ hawq_all_hosts = sorted(set(hawq_master_hosts + hawqsegment_hosts)) # HDFS hdfs_site = config['configurations']['hdfs-site'] default_fs = config['configurations']['core-site']['fs.defaultFS'] +hadoop_bin_dir = stack_select.get_hadoop_dir("bin") +hadoop_conf_dir = conf_select.get_hadoop_conf_dir() security_enabled = config['configurations']['cluster-env']['security_enabled'] hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab'] @@ -78,6 +82,8 @@ HdfsResource = functools.partial(HdfsResource, keytab=hdfs_user_keytab, kinit_path_local=kinit_path_local, principal_name=hdfs_principal_name, + hadoop_bin_dir = hadoop_bin_dir, + hadoop_conf_dir = hadoop_conf_dir, hdfs_site=hdfs_site, default_fs=default_fs, immutable_paths = get_not_managed_resources()) http://git-wip-us.apache.org/repos/asf/ambari/blob/f6e5618d/ambari-server/src/test/python/common-services/HAWQ/test_hawqmaster.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/common-services/HAWQ/test_hawqmaster.py b/ambari-server/src/test/python/common-services/HAWQ/test_hawqmaster.py index a483656..3b09309 100644 --- a/ambari-server/src/test/python/common-services/HAWQ/test_hawqmaster.py +++ b/ambari-server/src/test/python/common-services/HAWQ/test_hawqmaster.py @@ -78,6 +78,8 @@ class TestHawqMaster(HawqBaseTestCase): self.assertResourceCalled('HdfsResource', '/hawq_data', immutable_paths = self.DEFAULT_IMMUTABLE_PATHS, default_fs = u'hdfs://c6401.ambari.apache.org:8020', + hadoop_bin_dir = '/usr/phd/current/hadoop-client/bin', + hadoop_conf_dir = '/usr/phd/current/hadoop-client/conf', hdfs_site = self.getConfig()['configurations']['hdfs-site'], type = 'directory', action = ['create_on_execute'], @@ -95,6 +97,8 @@ class TestHawqMaster(HawqBaseTestCase): self.assertResourceCalled('HdfsResource', None, immutable_paths = self.DEFAULT_IMMUTABLE_PATHS, default_fs = u'hdfs://c6401.ambari.apache.org:8020', + hadoop_bin_dir = '/usr/phd/current/hadoop-client/bin', + hadoop_conf_dir = '/usr/phd/current/hadoop-client/conf', hdfs_site = self.getConfig()['configurations']['hdfs-site'], action = ['execute'], user = u'hdfs',