فهرست منبع

AMBARI-5695. Oozie HTTP and Admin ports cannot be modified (aonishuk)

Andrew Onishuk 11 سال پیش
والد
کامیت
586e3e6055
16فایلهای تغییر یافته به همراه84 افزوده شده و 20 حذف شده
  1. 1 0
      ambari-agent/src/main/python/resource_management/libraries/functions/__init__.py
  2. 31 0
      ambari-agent/src/main/python/resource_management/libraries/functions/get_port_from_url.py
  3. 0 6
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/functions.py
  4. 1 2
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
  5. 5 0
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/configuration/global.xml
  6. 2 0
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py
  7. 5 1
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/templates/oozie-env.sh.j2
  8. 0 6
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/functions.py
  9. 1 2
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/params.py
  10. 5 0
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/configuration/global.xml
  11. 2 0
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
  12. 5 1
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/templates/oozie-env.sh.j2
  13. 2 1
      ambari-server/src/test/python/stacks/1.3.2/configs/default.json
  14. 2 1
      ambari-server/src/test/python/stacks/2.0.6/configs/default.json
  15. 11 0
      ambari-web/app/data/HDP2/global_properties.js
  16. 11 0
      ambari-web/app/data/global_properties.js

+ 1 - 0
ambari-agent/src/main/python/resource_management/libraries/functions/__init__.py

@@ -27,3 +27,4 @@ from resource_management.libraries.functions.get_unique_id_and_date import *
 from resource_management.libraries.functions.check_process_status import *
 from resource_management.libraries.functions.is_empty import *
 from resource_management.libraries.functions.substitute_vars import *
+from resource_management.libraries.functions.get_port_from_url import *

+ 31 - 0
ambari-agent/src/main/python/resource_management/libraries/functions/get_port_from_url.py

@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Ambari Agent
+
+"""
+
+from resource_management import *
+from resource_management.libraries.functions.is_empty import *
+from urlparse import urlparse
+
+def get_port_from_url(address):
+  if not is_empty(address):
+    return urlparse(address).port
+  else:
+    return address

+ 0 - 6
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/functions.py

@@ -21,12 +21,6 @@ Ambari Agent
 """
 from resource_management import *
 
-def get_port_from_url(address):
-  if not is_empty(address):
-    return address.split(':')[-1]
-  else:
-    return address
-
 # Gets if the java version is greater than 6
 def is_jdk_greater_6(java64_home):
   import os

+ 1 - 2
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py

@@ -20,7 +20,6 @@ Ambari Agent
 
 """
 
-from functions import get_port_from_url
 from functions import is_jdk_greater_6
 from resource_management import *
 import status_params
@@ -50,7 +49,7 @@ nagios_principal_name = default("nagios_principal_name", "nagios")
 hadoop_ssl_enabled = False
 
 namenode_metadata_port = get_port_from_url(config['configurations']['core-site']['fs.default.name'])
-oozie_server_port = "11000"
+oozie_server_port = get_port_from_url(config['configurations']['oozie-site']['oozie.base.url'])
 # different to HDP2    
 namenode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.http.address'])
 # different to HDP2  

+ 5 - 0
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/configuration/global.xml

@@ -67,5 +67,10 @@
     <value>/var/run/oozie</value>
     <description>Directory in which the pid files for oozie reside.</description>
   </property>
+  <property>
+    <name>oozie_admin_port</name>
+    <value>11001</value>
+    <description>The admin port Oozie server runs.</description>
+  </property>  
 
 </configuration>

+ 2 - 0
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py

@@ -60,6 +60,8 @@ oozie_metastore_user_passwd = default("/configurations/oozie-site/oozie.service.
 oozie_jdbc_connection_url = default("/configurations/oozie-site/oozie.service.JPAService.jdbc.url", "")
 oozie_log_dir = config['configurations']['global']['oozie_log_dir']
 oozie_data_dir = config['configurations']['global']['oozie_data_dir']
+oozie_server_port = get_port_from_url(config['configurations']['oozie-site']['oozie.base.url'])
+oozie_server_admin_port = config['configurations']['global']['oozie_admin_port']
 oozie_lib_dir = "/var/lib/oozie/"
 oozie_webapps_dir = "/var/lib/oozie/oozie-server/webapps/"
 

+ 5 - 1
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/templates/oozie-env.sh.j2

@@ -72,7 +72,11 @@ export OOZIE_DATA={{oozie_data_dir}}
 
 # The port Oozie server runs
 #
-# export OOZIE_HTTP_PORT=11000
+export OOZIE_HTTP_PORT={{oozie_server_port}}
+
+# The admin port Oozie server runs
+#
+export OOZIE_ADMIN_PORT={{oozie_server_admin_port}}
 
 # The host name Oozie server runs on
 #

+ 0 - 6
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/functions.py

@@ -21,12 +21,6 @@ Ambari Agent
 """
 from resource_management import *
 
-def get_port_from_url(address):
-  if not is_empty(address):
-    return address.split(':')[-1]
-  else:
-    return address
-
 # Gets if the java version is greater than 6
 def is_jdk_greater_6(java64_home):
   import os

+ 1 - 2
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/params.py

@@ -20,7 +20,6 @@ Ambari Agent
 
 """
 
-from functions import get_port_from_url
 from functions import is_jdk_greater_6
 from resource_management import *
 import status_params
@@ -50,7 +49,7 @@ nagios_principal_name = default("nagios_principal_name", "nagios")
 hadoop_ssl_enabled = False
 
 namenode_metadata_port = get_port_from_url(config['configurations']['core-site']['fs.defaultFS'])
-oozie_server_port = "11000"
+oozie_server_port = get_port_from_url(config['configurations']['oozie-site']['oozie.base.url'])
 # different to HDP1    
 namenode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.http-address'])
 # different to HDP1  

+ 5 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/configuration/global.xml

@@ -66,5 +66,10 @@
     <value>/var/run/oozie</value>
     <description>Directory in which the pid files for oozie reside.</description>
   </property>
+  <property>
+    <name>oozie_admin_port</name>
+    <value>11001</value>
+    <description>The admin port Oozie server runs.</description>
+  </property>
 
 </configuration>

+ 2 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py

@@ -60,6 +60,8 @@ oozie_metastore_user_passwd = default("/configurations/oozie-site/oozie.service.
 oozie_jdbc_connection_url = default("/configurations/oozie-site/oozie.service.JPAService.jdbc.url", "")
 oozie_log_dir = config['configurations']['global']['oozie_log_dir']
 oozie_data_dir = config['configurations']['global']['oozie_data_dir']
+oozie_server_port = get_port_from_url(config['configurations']['oozie-site']['oozie.base.url'])
+oozie_server_admin_port = config['configurations']['global']['oozie_admin_port']
 oozie_lib_dir = "/var/lib/oozie/"
 oozie_webapps_dir = "/var/lib/oozie/oozie-server/webapps/"
 

+ 5 - 1
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/templates/oozie-env.sh.j2

@@ -79,7 +79,11 @@ export OOZIE_DATA={{oozie_data_dir}}
 
 # The port Oozie server runs
 #
-# export OOZIE_HTTP_PORT=11000
+export OOZIE_HTTP_PORT={{oozie_server_port}}
+
+# The admin port Oozie server runs
+#
+export OOZIE_ADMIN_PORT={{oozie_server_admin_port}}
 
 # The host name Oozie server runs on
 #

+ 2 - 1
ambari-server/src/test/python/stacks/1.3.2/configs/default.json

@@ -218,7 +218,8 @@
             "hadoop_heapsize": "1024", 
             "hadoop_pid_dir_prefix": "/var/run/hadoop", 
             "nagios_user": "nagios", 
-            "hbase_log_dir": "/var/log/hbase"
+            "hbase_log_dir": "/var/log/hbase",
+            "oozie_admin_port": "11001"
         }, 
         "hdfs-site": {
             "dfs.namenode.avoid.write.stale.datanode": "true", 

+ 2 - 1
ambari-server/src/test/python/stacks/2.0.6/configs/default.json

@@ -292,7 +292,8 @@
             "falcon_port": "15000",
             "falcon_local_dir": "/hadoop/falcon",
             "tez_user": "tez",
-            "rca_enabled": "false"
+            "rca_enabled": "false",
+            "oozie_admin_port": "11001"
         }, 
         "capacity-scheduler": {
             "yarn.scheduler.capacity.node-locality-delay": "40", 

+ 11 - 0
ambari-web/app/data/HDP2/global_properties.js

@@ -1128,6 +1128,17 @@ module.exports =
       "serviceName": "OOZIE",
       "category": "Advanced"
     },
+    {
+      "id": "puppet var",
+      "name": "oozie_admin_port",
+      "displayName": "Oozie Server Admin Port",
+      "isReconfigurable": true,
+      "displayType": "int",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "OOZIE",
+      "category": "Advanced"
+    },
   /**********************************************NAGIOS***************************************/
     {
       "id": "puppet var",

+ 11 - 0
ambari-web/app/data/global_properties.js

@@ -1057,6 +1057,17 @@ module.exports =
       "serviceName": "OOZIE",
       "category": "Advanced"
     },
+    {
+      "id": "puppet var",
+      "name": "oozie_admin_port",
+      "displayName": "Oozie Server Admin Port",
+      "isReconfigurable": true,
+      "displayType": "int",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "OOZIE",
+      "category": "Advanced"
+    },
   /**********************************************NAGIOS***************************************/
     {
       "id": "puppet var",