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 2015/06/05 10:59:39 UTC
ambari git commit: AMBARI-11712. Having wire encryption + NN HA
enabled hdfs directories will fail to create (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/trunk 3bb8af2bb -> 13225f9de
AMBARI-11712. Having wire encryption + NN HA enabled hdfs directories will fail to create (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/13225f9d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/13225f9d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/13225f9d
Branch: refs/heads/trunk
Commit: 13225f9de5e1533c1aa399401499174ca6fedd84
Parents: 3bb8af2
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Jun 5 11:59:32 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Fri Jun 5 11:59:32 2015 +0300
----------------------------------------------------------------------
.../libraries/functions/namenode_ha_utils.py | 13 ++++++++-----
.../HDFS/2.1.0.2.0/package/scripts/params_linux.py | 4 ++--
2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/13225f9d/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
index 0d9e28b..247d6e9 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
@@ -29,7 +29,7 @@ HDFS_NN_STATE_STANDBY = 'standby'
NAMENODE_HTTP_FRAGMENT = 'dfs.namenode.http-address.{0}.{1}'
NAMENODE_HTTPS_FRAGMENT = 'dfs.namenode.https-address.{0}.{1}'
-JMX_URI_FRAGMENT = "http://{0}/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus"
+JMX_URI_FRAGMENT = "{0}://{1}/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus"
def get_namenode_states(hdfs_site, security_enabled, run_user):
"""
@@ -47,18 +47,21 @@ def get_namenode_states(hdfs_site, security_enabled, run_user):
# ie dfs.namenode.http-address.hacluster.nn1
nn_unique_ids = hdfs_site[nn_unique_ids_key].split(',')
for nn_unique_id in nn_unique_ids:
- is_https_enabled = hdfs_site['dfs.https.enabled'] if not is_empty(hdfs_site['dfs.https.enabled']) else False
+ is_https_enabled = hdfs_site['dfs.https.enable'] if not is_empty(hdfs_site['dfs.https.enable']) else False
if not is_https_enabled:
key = NAMENODE_HTTP_FRAGMENT.format(name_service,nn_unique_id)
+ protocol = "http"
else:
- key = "https://" + NAMENODE_HTTPS_FRAGMENT.format(name_service,nn_unique_id)
-
+ key = NAMENODE_HTTPS_FRAGMENT.format(name_service,nn_unique_id)
+ protocol = "https"
+
if key in hdfs_site:
# use str() to ensure that unicode strings do not have the u' in them
value = str(hdfs_site[key])
- jmx_uri = JMX_URI_FRAGMENT.format(value)
+ jmx_uri = JMX_URI_FRAGMENT.format(protocol, value)
+
state = get_value_from_jmx(jmx_uri, 'State', security_enabled, run_user, is_https_enabled)
if state == HDFS_NN_STATE_ACTIVE:
http://git-wip-us.apache.org/repos/asf/ambari/blob/13225f9d/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
index c6b10b8..bc5a96b 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
@@ -385,8 +385,8 @@ policy_user = config['configurations']['ranger-hdfs-plugin-properties']['policy_
jdk_location = config['hostLevelParams']['jdk_location']
java_share_dir = '/usr/share/java'
-is_https_enabled = config['configurations']['hdfs-site']['dfs.https.enabled'] if \
- not is_empty(config['configurations']['hdfs-site']['dfs.https.enabled']) else False
+is_https_enabled = config['configurations']['hdfs-site']['dfs.https.enable'] if \
+ not is_empty(config['configurations']['hdfs-site']['dfs.https.enable']) else False
if has_ranger_admin:
enable_ranger_hdfs = (config['configurations']['ranger-hdfs-plugin-properties']['ranger-hdfs-plugin-enabled'].lower() == 'yes')