You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2014/05/08 12:31:41 UTC

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

Repository: ambari
Updated Branches:
  refs/heads/trunk c991897b4 -> 586e3e605


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


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

Branch: refs/heads/trunk
Commit: 586e3e6055020920a388e1709446c0c7ee651cac
Parents: c991897
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu May 8 13:29:52 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu May 8 13:31:31 2014 +0300

----------------------------------------------------------------------
 .../libraries/functions/__init__.py             |  1 +
 .../libraries/functions/get_port_from_url.py    | 31 ++++++++++++++++++++
 .../NAGIOS/package/scripts/functions.py         |  6 ----
 .../services/NAGIOS/package/scripts/params.py   |  3 +-
 .../services/OOZIE/configuration/global.xml     |  5 ++++
 .../services/OOZIE/package/scripts/params.py    |  2 ++
 .../OOZIE/package/templates/oozie-env.sh.j2     |  6 +++-
 .../NAGIOS/package/scripts/functions.py         |  6 ----
 .../services/NAGIOS/package/scripts/params.py   |  3 +-
 .../services/OOZIE/configuration/global.xml     |  5 ++++
 .../services/OOZIE/package/scripts/params.py    |  2 ++
 .../OOZIE/package/templates/oozie-env.sh.j2     |  6 +++-
 .../python/stacks/1.3.2/configs/default.json    |  3 +-
 .../python/stacks/2.0.6/configs/default.json    |  3 +-
 ambari-web/app/data/HDP2/global_properties.js   | 11 +++++++
 ambari-web/app/data/global_properties.js        | 11 +++++++
 16 files changed, 84 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-agent/src/main/python/resource_management/libraries/functions/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/resource_management/libraries/functions/__init__.py b/ambari-agent/src/main/python/resource_management/libraries/functions/__init__.py
index 32e886b..ec2fdeb 100644
--- a/ambari-agent/src/main/python/resource_management/libraries/functions/__init__.py
+++ b/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 *

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-agent/src/main/python/resource_management/libraries/functions/get_port_from_url.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/resource_management/libraries/functions/get_port_from_url.py b/ambari-agent/src/main/python/resource_management/libraries/functions/get_port_from_url.py
new file mode 100644
index 0000000..ce9185b
--- /dev/null
+++ b/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/functions.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/functions.py
index 295f42a..7252f8f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/functions.py
+++ b/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

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
index 3b713c6..5df2767 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
+++ b/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  

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/configuration/global.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/configuration/global.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/configuration/global.xml
index 87dae9e..657317b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/configuration/global.xml
+++ b/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>

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py
index bb6e27c..7a17cec 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py
+++ b/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/"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/templates/oozie-env.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/templates/oozie-env.sh.j2 b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/templates/oozie-env.sh.j2
index 9a57108..502ea61 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/templates/oozie-env.sh.j2
+++ b/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
 #

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/functions.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/functions.py
index 295f42a..7252f8f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/functions.py
+++ b/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

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/params.py
index 2e41c23..adeff77 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/params.py
+++ b/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  

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/configuration/global.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/configuration/global.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/configuration/global.xml
index d24d859..a9e897e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/configuration/global.xml
+++ b/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>

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
index 9a5df00..175608f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
+++ b/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/"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/templates/oozie-env.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/templates/oozie-env.sh.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/templates/oozie-env.sh.j2
index 602992a..4eb12cc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/templates/oozie-env.sh.j2
+++ b/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
 #

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/test/python/stacks/1.3.2/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/configs/default.json b/ambari-server/src/test/python/stacks/1.3.2/configs/default.json
index 40cdc57..f233f77 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/configs/default.json
+++ b/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", 

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
index c621a6d..7a76996 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
+++ b/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", 

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-web/app/data/HDP2/global_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/global_properties.js b/ambari-web/app/data/HDP2/global_properties.js
index 439212a..5f6cb5a 100644
--- a/ambari-web/app/data/HDP2/global_properties.js
+++ b/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",

http://git-wip-us.apache.org/repos/asf/ambari/blob/586e3e60/ambari-web/app/data/global_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/global_properties.js b/ambari-web/app/data/global_properties.js
index 00cd484..86507c0 100644
--- a/ambari-web/app/data/global_properties.js
+++ b/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",