You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/09/15 22:21:56 UTC

ambari git commit: AMBARI-12410. atlas service definition needs to leverage persistent http/https port properties (Jonathan Maron via alejandro)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 4cf726771 -> 793c2affa


AMBARI-12410. atlas service definition needs to leverage persistent http/https port properties (Jonathan Maron via alejandro)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/793c2aff
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/793c2aff
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/793c2aff

Branch: refs/heads/branch-2.1
Commit: 793c2affaae34254e0b48ddce4f444f0cbf5f67b
Parents: 4cf7267
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Tue Sep 15 13:21:16 2015 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Tue Sep 15 13:21:16 2015 -0700

----------------------------------------------------------------------
 .../common-services/ATLAS/0.1.0.2.3/alerts.json   |  6 +++---
 .../configuration/application-properties.xml      | 10 ++++++++++
 .../ATLAS/0.1.0.2.3/configuration/atlas-env.xml   |  5 -----
 .../0.1.0.2.3/package/scripts/metadata_server.py  |  2 +-
 .../ATLAS/0.1.0.2.3/package/scripts/params.py     | 10 +++++++++-
 .../HIVE/0.12.0.2.0/configuration/hive-site.xml   | 18 ++++++++++++++----
 .../2.2/services/HIVE/configuration/hive-site.xml |  8 ++++++--
 .../stacks/HDP/2.3/services/stack_advisor.py      | 18 ++++++------------
 .../stacks/2.3/ATLAS/test_metadata_server.py      |  2 +-
 .../test/python/stacks/2.3/configs/default.json   |  3 ++-
 ambari-web/app/models/quick_links.js              |  6 +++---
 11 files changed, 55 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/793c2aff/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/793c2aff/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/793c2aff/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/793c2aff/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/793c2aff/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..f1c1d8d 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
@@ -21,6 +21,7 @@ import os
 import sys
 from resource_management import format_hdp_stack_version, Script
 from resource_management.libraries.functions import format
+from resource_management.libraries.functions.default import default
 
 import status_params
 
@@ -62,7 +63,14 @@ 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 = default("/configurations/application-properties/atlas.enableTLS", False)
+http_port = default("/configurations/application-properties/atlas.server.http.port", 21000)
+https_port = default("/configurations/application-properties/atlas.server.https.port", 21443)
+if ssl_enabled:
+  metadata_port = https_port
+else:
+  metadata_port = http_port
+
 metadata_host = config['hostname']
 
 # application properties

http://git-wip-us.apache.org/repos/asf/ambari/blob/793c2aff/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..d4bcc0e 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
@@ -373,9 +373,15 @@ limitations under the License.
     </value-attributes>
   </property>
 
-  <property require-input="true">
+  <property>
     <name>atlas.cluster.name</name>
-    <value></value>
+    <value>primary</value>
+    <depends-on>
+      <property>
+        <type>application-properties</type>
+        <name>atlas.enableTLS</name>
+      </property>
+    </depends-on>
   </property>
 
   <property>
@@ -387,8 +393,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/793c2aff/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/793c2aff/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..d7ea10f 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
@@ -213,25 +213,19 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
     putHiveSiteProperty(hooks_property, hooks_value)
 
     if include_atlas:
-      cluster_name = ''
-      if 'hive-site' in services['configurations']:
-        if 'atlas.cluster.name' in services['configurations']['hive-site']['properties']:
-          cluster_name = services['configurations']['hive-site']['properties']['atlas.cluster.name']
-          if not cluster_name.strip():
-            # set the cluster name to empty string so that user is prompted for value
-            cluster_name = ''
-
+      cluster_name = 'default'
       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/793c2aff/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/793c2aff/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/_HOST@EXAMPLE.COM",
         "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/793c2aff/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