Repository: ambari Updated Branches: refs/heads/branch-2.1 16713b896 -> 973831b1d
AMBARI-12410. Leverage atlas configured port properties for server (Jon Maron via smohanty) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/973831b1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/973831b1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/973831b1 Branch: refs/heads/branch-2.1 Commit: 973831b1ddd16bee25b5bfef4099817a8a14eece Parents: 16713b8 Author: Sumit Mohanty <[email protected]> Authored: Mon Sep 14 08:02:14 2015 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Mon Sep 14 08:02:45 2015 -0700 ---------------------------------------------------------------------- .../resources/common-services/ATLAS/0.1.0.2.3/alerts.json | 6 +++--- .../0.1.0.2.3/configuration/application-properties.xml | 10 ++++++++++ .../ATLAS/0.1.0.2.3/configuration/atlas-env.xml | 5 ----- .../ATLAS/0.1.0.2.3/package/scripts/metadata_server.py | 2 +- .../ATLAS/0.1.0.2.3/package/scripts/params.py | 7 ++++++- .../HIVE/0.12.0.2.0/configuration/hive-site.xml | 8 ++++++-- .../HDP/2.2/services/HIVE/configuration/hive-site.xml | 8 ++++++-- .../resources/stacks/HDP/2.3/services/stack_advisor.py | 9 +++++---- .../test/python/stacks/2.3/ATLAS/test_metadata_server.py | 2 +- .../src/test/python/stacks/2.3/configs/default.json | 3 ++- ambari-web/app/models/quick_links.js | 6 +++--- 11 files changed, 43 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json index f324707..5eaaace 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json @@ -10,7 +10,7 @@ "scope": "ANY", "source": { "type": "PORT", - "uri": "{{atlas-env/metadata_port}}", + "uri": "{{application-properties/atlas.server.http.port}}", "default_port": 21000, "reporting": { "ok": { @@ -37,8 +37,8 @@ "source": { "type": "WEB", "uri": { - "http": "{{hostname}}:{{atlas-env/metadata_port}}", - "https": "{{hostname}}:21443", + "http": "{{hostname}}:{{application-properties/atlas.server.http.port}}", + "https": "{{hostname}}:{{application-properties/atlas.server.https.port}}", "https_property": "{{application-properties/atlas.enableTLS}}", "https_property_value": "true", "default_port": 21000, http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml index 386fbdc..82dacb6 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml @@ -130,5 +130,15 @@ DEFAULT</value> <description></description> </property> + <property> + <name>atlas.server.http.port</name> + <value>21000</value> + <description></description> + </property> + <property> + <name>atlas.server.https.port</name> + <value>21443</value> + <description></description> + </property> </configuration> http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/atlas-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/atlas-env.xml b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/atlas-env.xml index 991d7fe..0ca741c 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/atlas-env.xml +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/atlas-env.xml @@ -20,11 +20,6 @@ --> <configuration> <property require-input="false"> - <name>metadata_port</name> - <value>21000</value> - <description>Listening port of the Atlas server.</description> - </property> - <property require-input="false"> <name>metadata_log_dir</name> <value>/var/log/atlas</value> <description>Atlas log directory.</description> http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py index 6c5a87e..d4a7837 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py @@ -46,7 +46,7 @@ class MetadataServer(Script): env.set_params(params) self.configure(env) - daemon_cmd = format('source {params.conf_dir}/atlas-env.sh ; {params.metadata_start_script} --port {params.metadata_port}') + daemon_cmd = format('source {params.conf_dir}/atlas-env.sh ; {params.metadata_start_script}') no_op_test = format('ls {params.pid_file} >/dev/null 2>&1 && ps -p `cat {params.pid_file}` >/dev/null 2>&1') Execute(daemon_cmd, user=params.metadata_user, http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/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 a7c6d7a..15028c0 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 @@ -62,7 +62,12 @@ env_sh_template = config['configurations']['atlas-env']['content'] credential_provider = format( "jceks://file@{conf_dir}/atlas-site.jceks") # command line args -metadata_port = config['configurations']['atlas-env']['metadata_port'] +ssl_enabled = config['configurations']['application-properties']['atlas.enableTLS'] +if ssl_enabled: + metadata_port = config['configurations']['application-properties']['atlas.server.https.port'] +else: + metadata_port = config['configurations']['application-properties']['atlas.server.http.port'] + metadata_host = config['hostname'] # application properties http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml index 2783b78..a040ac5 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml @@ -387,8 +387,12 @@ limitations under the License. <name>atlas.enableTLS</name> </property> <property> - <type>atlas-env</type> - <name>metadata_port</name> + <type>application-properties</type> + <name>atlas.server.http.port</name> + </property> + <property> + <type>application-properties</type> + <name>atlas.server.https.port</name> </property> </depends-on> </property> http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml index 5811e4f..c3ad55a 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml @@ -230,8 +230,12 @@ limitations under the License. <name>hive_timeline_logging_enabled</name> </property> <property> - <type>atlast-env</type> - <name>metadata_port</name> + <type>application-properties</type> + <name>atlas.server.http.port</name> + </property> + <property> + <type>application-properties</type> + <name>atlas.server.https.port</name> </property> </depends-on> </property> http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/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 dd287b2..ca07ac9 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 @@ -222,16 +222,17 @@ class HDP23StackAdvisor(HDP22StackAdvisor): cluster_name = '' putHiveSiteProperty('atlas.cluster.name', cluster_name) - metadata_port = "21000" - if 'atlas-env' in services['configurations']: - metadata_port = services['configurations']['atlas-env']['properties']['metadata_port'] metadata_host_info = self.getHostWithComponent("ATLAS", "ATLAS_SERVER", services, hosts) metadata_host = metadata_host_info['Hosts']['host_name'] scheme = "http" + metadata_port = "21000" + tls_enabled = "false" if 'application-properties' in services['configurations']: tls_enabled = services['configurations']['application-properties']['properties']['atlas.enableTLS'] - if tls_enabled.lower() == 'true': + metadata_port = services['configurations']['application-properties']['properties']['atlas.server.http.port'] + if tls_enabled.lower() == "true": scheme = "https" + metadata_port = services['configurations']['application-properties']['properties']['atlas.server.https.port'] putHiveSiteProperty('atlas.rest.address', '{0}://{1}:{2}'.format(scheme, metadata_host, metadata_port)) else: putHiveSitePropertyAttribute('atlas.cluster.name', 'delete', 'true') http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/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 cff446f..7435fb9 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 @@ -115,7 +115,7 @@ class TestMetadataServer(RMFTestCase): target = RMFTestCase.TARGET_COMMON_SERVICES ) self.configureResourcesCalled() - self.assertResourceCalled('Execute', 'source /etc/atlas/conf/atlas-env.sh ; /usr/hdp/current/atlas-server/bin/atlas_start.py --port 21000', + 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/973831b1/ambari-server/src/test/python/stacks/2.3/configs/default.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/configs/default.json b/ambari-server/src/test/python/stacks/2.3/configs/default.json index 688065c..d78f517 100644 --- a/ambari-server/src/test/python/stacks/2.3/configs/default.json +++ b/ambari-server/src/test/python/stacks/2.3/configs/default.json @@ -181,7 +181,8 @@ "atlas.http.authentication.type": "simple", "atlas.http.authentication.kerberos.principal": "HTTP/[email protected]", "atlas.http.authentication.kerberos.keytab": "/etc/security/keytabs/spnego.service.keytab", - "atlas.http.authentication.kerberos.name.rules": "DEFAULT" + "atlas.http.authentication.kerberos.name.rules": "DEFAULT", + "atlas.server.http.port" : "21000" }, "atlas-env": { "content": "# The java implementation to use. If JAVA_HOME is not found we expect java and jar to be in path\nexport JAVA_HOME={{java64_home}}\n# any additional java opts you want to set. This will apply to both client and server operations\nexport METADATA_OPTS={{metadata_opts}}\n# metadata configuration directory\nexport METADATA_CONF={{conf_dir}}\n# Where log files are stored. Defatult is logs directory under the base install location\nexport METADATA_LOG_DIR={{log_dir}}\n# additional classpath entries\nexport METADATACPPATH={{metadata_classpath}}\n# data dir\nexport METADATA_DATA_DIR={{data_dir}}\n# Where do you want to expand the war file. By Default it is in /server/webapp dir under the base install dir.\nexport METADATA_EXPANDED_WEBAPP_DIR={{expanded_war_dir}}", http://git-wip-us.apache.org/repos/asf/ambari/blob/973831b1/ambari-web/app/models/quick_links.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/quick_links.js b/ambari-web/app/models/quick_links.js index b1f95d6..8fe6be6 100644 --- a/ambari-web/app/models/quick_links.js +++ b/ambari-web/app/models/quick_links.js @@ -337,9 +337,9 @@ App.QuickLinks.FIXTURES = [ url:'%@://%@:%@/#!/search?user.name=%@', service_id: 'ATLAS', template:'%@://%@:%@/#!/search?user.name=%@', - http_config: 'metadata_port', - https_config: 'metadata_port', - site: 'atlas-env', + http_config: 'atlas.server.http.port', + https_config: 'atlas.server.https.port', + site: 'application-properties', regex: '^(\\d+)$', default_http_port: 21000, default_https_port: 21443
