Repository: ambari Updated Branches: refs/heads/branch-2.5 77b4113ab -> 5f63b67a5
AMBARI-19029 : Atlas web UI inaccessible alert after enabling Namenode-HA (Vishal Suvagia via mugdha) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5f63b67a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5f63b67a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5f63b67a Branch: refs/heads/branch-2.5 Commit: 5f63b67a590ae5082dfef9a002ad10d83ceaebf8 Parents: 77b4113 Author: Vishal Suvagia <[email protected]> Authored: Fri Jan 13 19:07:03 2017 +0530 Committer: Mugdha Varadkar <[email protected]> Committed: Mon Jan 16 10:54:54 2017 +0530 ---------------------------------------------------------------------- .../libraries/functions/constants.py | 1 + .../ATLAS/0.1.0.2.3/package/scripts/metadata.py | 13 +++++++++++++ .../ATLAS/0.1.0.2.3/package/scripts/params.py | 6 ++++-- .../stacks/HDP/2.0.6/properties/stack_features.json | 5 +++++ .../stacks/HDP/2.6/services/ATLAS/metainfo.xml | 4 +++- .../python/stacks/2.3/ATLAS/test_metadata_server.py | 8 ++++++++ .../test/python/stacks/2.5/ATLAS/test_atlas_server.py | 2 ++ 7 files changed, 36 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/5f63b67a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py index 05510cd..56af615 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py @@ -110,3 +110,4 @@ class StackFeature: HIVE_INTERACTIVE_ATLAS_HOOK_REQUIRED="hive_interactive_atlas_hook_required" CORE_SITE_FOR_RANGER_PLUGINS_SUPPORT='core_site_for_ranger_plugins' ATLAS_INSTALL_HOOK_PACKAGE_SUPPORT="atlas_install_hook_package_support" + ATLAS_HDFS_SITE_ON_NAMENODE_HA='atlas_hdfs_site_on_namenode_ha' http://git-wip-us.apache.org/repos/asf/ambari/blob/5f63b67a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py index a568cb7..2232bb2 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py @@ -30,6 +30,7 @@ from resource_management.libraries.functions import solr_cloud_util from resource_management.libraries.functions.stack_features import check_stack_feature, get_stack_feature_version from resource_management.libraries.resources.properties_file import PropertiesFile from resource_management.libraries.resources.template_config import TemplateConfig +from resource_management.libraries.resources.xml_config import XmlConfig def metadata(type='server'): @@ -163,6 +164,18 @@ def metadata(type='server'): owner=params.kafka_user, content=Template("kafka_jaas.conf.j2")) + if params.stack_supports_atlas_hdfs_site_on_namenode_ha and len(params.namenode_host) > 1: + XmlConfig("hdfs-site.xml", + conf_dir=params.conf_dir, + configurations=params.config['configurations']['hdfs-site'], + configuration_attributes=params.config['configuration_attributes']['hdfs-site'], + owner=params.metadata_user, + group=params.user_group, + mode=0644 + ) + else: + File(format('{conf_dir}/hdfs-site.xml'), action="delete") + def upload_conf_set(config_set, jaasFile): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/5f63b67a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py index 9373f17..2418326 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py @@ -221,6 +221,7 @@ for host in zookeeper_hosts: # Atlas Ranger plugin configurations stack_supports_atlas_ranger_plugin = check_stack_feature(StackFeature.ATLAS_RANGER_PLUGIN_SUPPORT, version_for_stack_feature_checks) stack_supports_ranger_kerberos = check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, version_for_stack_feature_checks) +stack_supports_atlas_hdfs_site_on_namenode_ha = check_stack_feature(StackFeature.ATLAS_HDFS_SITE_ON_NAMENODE_HA, version_for_stack_feature_checks) retry_enabled = default("/commandParams/command_retry_enabled", False) ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", []) @@ -283,10 +284,11 @@ if check_stack_feature(StackFeature.ATLAS_UPGRADE_SUPPORT, version_for_stack_fea kafka_jaas_principal = None kafka_keytab_path = None +namenode_host = set(default("/clusterHostInfo/namenode_host", [])) +has_namenode = not len(namenode_host) == 0 + if has_ranger_admin and stack_supports_atlas_ranger_plugin: # for create_hdfs_directory - namenode_host = set(default("/clusterHostInfo/namenode_host", [])) - has_namenode = not len(namenode_host) == 0 hdfs_user = config['configurations']['hadoop-env']['hdfs_user'] if has_namenode else None hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab'] if has_namenode else None hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name'] if has_namenode else None http://git-wip-us.apache.org/repos/asf/ambari/blob/5f63b67a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json index bb7f596..fd7fac9 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json @@ -353,6 +353,11 @@ "name": "atlas_install_hook_package_support", "description": "Stop installing packages from 2.6", "max_version": "2.5.9.9" + }, + { + "name": "atlas_hdfs_site_on_namenode_ha", + "description": "Need to create hdfs-site under atlas-conf dir when Namenode-HA is enabled.", + "min_version": "2.6.0.0" } ] } http://git-wip-us.apache.org/repos/asf/ambari/blob/5f63b67a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml index eaa5e21..a652a7b 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml @@ -28,7 +28,9 @@ <default>true</default> </theme> </themes> - + <configuration-dependencies> + <config-type>hdfs-site</config-type> + </configuration-dependencies> </service> </services> </metainfo> http://git-wip-us.apache.org/repos/asf/ambari/blob/5f63b67a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py index f2fec70..7d501a7 100644 --- a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py +++ b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py @@ -326,6 +326,8 @@ class TestMetadataServer(RMFTestCase): group = "hadoop", content=Template("atlas_hbase_setup.rb.j2")) + self.assertResourceCalled('File', '/etc/atlas/conf/hdfs-site.xml',action = ['delete'],) + self.assertNoMoreResources() def test_configure_secure(self): @@ -344,6 +346,9 @@ class TestMetadataServer(RMFTestCase): group = "hadoop", content=Template("atlas_hbase_setup.rb.j2")) + self.assertResourceCalled('File', '/etc/atlas/conf/hdfs-site.xml',action = ['delete'],) + + self.assertNoMoreResources() def test_start_default(self): @@ -361,6 +366,9 @@ class TestMetadataServer(RMFTestCase): group = "hadoop", content=Template("atlas_hbase_setup.rb.j2")) + self.assertResourceCalled('File', '/etc/atlas/conf/hdfs-site.xml',action = ['delete'],) + + self.assertResourceCalled('Execute', 'source /etc/atlas/conf/atlas-env.sh ; /usr/hdp/current/atlas-server/bin/atlas_start.py', not_if = 'ls /var/run/atlas/atlas.pid >/dev/null 2>&1 && ps -p `cat /var/run/atlas/atlas.pid` >/dev/null 2>&1', user = 'atlas', http://git-wip-us.apache.org/repos/asf/ambari/blob/5f63b67a/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py b/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py index 584763d..4db31ca 100644 --- a/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py +++ b/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py @@ -182,6 +182,8 @@ class TestAtlasServer(RMFTestCase): group = "hadoop", content=Template("atlas_hbase_setup.rb.j2")) + self.assertResourceCalled('File', '/etc/atlas/conf/hdfs-site.xml',action = ['delete'],) + self.assertNoMoreResources() @patch("resource_management.libraries.functions.security_commons.build_expectations")
