ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject git commit: AMBARI-4954. After configuring NNHA, nn process alerts do not work.(vbrodetskyi)
Date Wed, 05 Mar 2014 18:33:29 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 99fb2b9b2 -> 4f7a40943


AMBARI-4954. After configuring NNHA, nn process alerts do not work.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 4f7a40943de02251d9733b03909a145228efb5cd
Parents: 99fb2b9
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Wed Mar 5 20:32:54 2014 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Wed Mar 5 20:33:14 2014 +0200

----------------------------------------------------------------------
 .../2.0.6/services/NAGIOS/package/scripts/params.py    | 13 +++++++++++--
 .../NAGIOS/package/templates/hadoop-services.cfg.j2    |  2 +-
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4f7a4094/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 813c626..fa3b17d 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
@@ -89,12 +89,21 @@ kinit_path_local = functions.get_kinit_path([default("kinit_path_local",None),
"
 
 dfs_ha_enabled = False
 dfs_ha_nameservices = default("/configurations/hdfs-site/dfs.nameservices", None)
-dfs_ha_namenode_ids = default(format("hdfs-site/dfs.ha.namenodes.{dfs_ha_nameservices}"),
None)
+dfs_ha_namenode_ids = default(format("/configurations/hdfs-site/dfs.ha.namenodes.{dfs_ha_nameservices}"),
None)
 if dfs_ha_namenode_ids:
-  dfs_ha_namenode_ids_array_len = len(dfs_ha_namenode_ids.split(","))
+  dfs_ha_namemodes_ids_list = dfs_ha_namenode_ids.split(",")
+  dfs_ha_namenode_ids_array_len = len(dfs_ha_namemodes_ids_list)
   if dfs_ha_namenode_ids_array_len > 1:
     dfs_ha_enabled = True
 
+nn_ha_host_port_map = {}
+if dfs_ha_enabled:
+  for nn_id in dfs_ha_namemodes_ids_list:
+    nn_host = config['configurations']['hdfs-site'][format('dfs.namenode.rpc-address.{dfs_ha_nameservices}.{nn_id}')]
+    nn_ha_host_port_map[nn_host.split(":")[0]] = nn_host.split(":")[1]
+else:
+  nn_ha_host_port_map[config['clusterHostInfo']['namenode_host'][0]] = namenode_metadata_port
+
 ganglia_port = "8651"
 ganglia_collector_slaves_port = "8660"
 ganglia_collector_namenode_port = "8661"

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f7a4094/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
index 6df0380..8000cc1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
@@ -385,7 +385,7 @@ define service {
         use                     hadoop-service
         service_description     NAMENODE::NameNode process on {{ namenode_hostname }}
         servicegroups           HDFS
-        check_command           check_tcp_wrapper!{{ namenode_metadata_port }}!-w 1 -c 1
+        check_command           check_tcp_wrapper!{{nn_ha_host_port_map[namenode_hostname]}}!-w
1 -c 1
         normal_check_interval   0.5
         retry_check_interval    0.25
         max_check_attempts      3


Mime
View raw message