AMBARI-21664. HDFS namenode rpc and connection load metrics are not showing. 
(swagle)


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

Branch: refs/heads/branch-feature-AMBARI-14714
Commit: 7a90a260497fccafcefaca209bd9bbd1f07a948a
Parents: 555f241
Author: Siddharth Wagle <swa...@hortonworks.com>
Authored: Mon Aug 7 15:57:36 2017 -0700
Committer: Siddharth Wagle <swa...@hortonworks.com>
Committed: Mon Aug 7 15:57:36 2017 -0700

----------------------------------------------------------------------
 .../HDP/2.0.6/hooks/before-START/scripts/params.py      | 11 ++++++++---
 .../stacks/HDP/3.0/hooks/before-START/scripts/params.py | 12 ++++++++++--
 2 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7a90a260/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
index a5bc849..2449d66 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
@@ -299,7 +299,6 @@ stack_version_formatted = 
format_stack_version(stack_version_unformatted)
 hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
 hdfs_principal_name = 
default('/configurations/hadoop-env/hdfs_principal_name', None)
 hdfs_site = config['configurations']['hdfs-site']
-default_fs = config['configurations']['core-site']['fs.defaultFS']
 smoke_user =  config['configurations']['cluster-env']['smokeuser']
 smoke_hdfs_user_dir = format("/user/{smoke_user}")
 smoke_hdfs_user_mode = 0770
@@ -338,11 +337,17 @@ if dfs_ha_enabled:
      namenode_rpc = nn_host
    pass
  pass
+elif 'dfs.namenode.rpc-address' in config['configurations']['hdfs-site']:
+  namenode_rpc = default('/configurations/hdfs-site/dfs.namenode.rpc-address', 
None)
 else:
- namenode_rpc = default('/configurations/hdfs-site/dfs.namenode.rpc-address', 
None)
+  namenode_rpc = default_fs
 
 if namenode_rpc:
- nn_rpc_client_port = namenode_rpc.split(':')[1].strip()
+  port_str = namenode_rpc.split(':')[-1].strip()
+  try:
+    nn_rpc_client_port = int(port_str)
+  except ValueError:
+    nn_rpc_client_port = None
 
 if dfs_ha_enabled:
  dfs_service_rpc_address = 
default(format('/configurations/hdfs-site/dfs.namenode.servicerpc-address.{dfs_ha_nameservices}.{namenode_id}'),
 None)

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a90a260/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/params.py
index a0259af..ecbb6a4 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/params.py
@@ -273,7 +273,6 @@ stack_version_formatted = 
format_stack_version(stack_version_unformatted)
 hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
 hdfs_principal_name = 
default('/configurations/hadoop-env/hdfs_principal_name', None)
 hdfs_site = config['configurations']['hdfs-site']
-default_fs = config['configurations']['core-site']['fs.defaultFS']
 smoke_user =  config['configurations']['cluster-env']['smokeuser']
 smoke_hdfs_user_dir = format("/user/{smoke_user}")
 smoke_hdfs_user_mode = 0770
@@ -312,8 +311,17 @@ if dfs_ha_enabled:
      namenode_rpc = nn_host
    pass
  pass
+elif 'dfs.namenode.rpc-address' in config['configurations']['hdfs-site']:
+  namenode_rpc = default('/configurations/hdfs-site/dfs.namenode.rpc-address', 
None)
 else:
- namenode_rpc = default('/configurations/hdfs-site/dfs.namenode.rpc-address', 
None)
+  namenode_rpc = default_fs
+
+if namenode_rpc:
+  port_str = namenode_rpc.split(':')[-1].strip()
+  try:
+    nn_rpc_client_port = int(port_str)
+  except ValueError:
+    nn_rpc_client_port = None
 
 if namenode_rpc:
  nn_rpc_client_port = namenode_rpc.split(':')[1].strip()

Reply via email to