ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eb...@apache.org
Subject git commit: AMBARI-6417 Nagios won't start on 2.1.GlusterFS stack (Scott Creeley via eboyd)
Date Wed, 09 Jul 2014 02:16:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 49a14e4f8 -> ed65cfdd0


AMBARI-6417 Nagios won't start on 2.1.GlusterFS stack (Scott Creeley via eboyd)


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

Branch: refs/heads/trunk
Commit: ed65cfdd026a739d5a112ab0e640b0bd958b9352
Parents: 49a14e4
Author: Erin A Boyd <eboyd@redhat.com>
Authored: Tue Jul 8 20:15:42 2014 -0600
Committer: Erin A Boyd <eboyd@redhat.com>
Committed: Tue Jul 8 20:15:42 2014 -0600

----------------------------------------------------------------------
 .../services/NAGIOS/package/scripts/params.py   | 30 ++++++++++++++++----
 .../templates/hadoop-servicegroups.cfg.j2       | 15 ++++++----
 .../package/templates/hadoop-services.cfg.j2    | 10 ++++---
 3 files changed, 39 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ed65cfdd/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 42ccb35..4f6d3f8 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
@@ -83,17 +83,26 @@ nagios_principal_name = default("nagios_principal_name", "nagios")
 hadoop_ssl_enabled = False
 
 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  
-snamenode_port = get_port_from_url(config['configurations']['hdfs-site']["dfs.namenode.secondary.http-address"])
+if 'dfs.namenode.http-address' in config['configurations']['hdfs-site']:
+  namenode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.http-address'])
+else:
+  namenode_port = "50070" 
+
+if 'dfs.namenode.secondary.http-address' in config['configurations']['hdfs-site']:
+  snamenode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.secondary.http-address'])
+else:
+  snamenode_port = "50071"
+
+if 'dfs.journalnode.http-address' in config['configurations']['hdfs-site']:
+  journalnode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.journalnode.http-address'])
+  datanode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.datanode.http.address'])
 
 hbase_master_rpc_port = default('/configurations/hbase-site/hbase.master.port', "60000")
 rm_port = get_port_from_url(config['configurations']['yarn-site']['yarn.resourcemanager.webapp.address'])
 nm_port = "8042"
 hs_port = get_port_from_url(config['configurations']['mapred-site']['mapreduce.jobhistory.webapp.address'])
-journalnode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.journalnode.http-address'])
-datanode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.datanode.http.address'])
 flume_port = "4159"
 hive_metastore_port = get_port_from_url(config['configurations']['hive-site']['hive.metastore.uris'])
#"9083"
 hive_server_port = default('/configurations/hive-site/hive.server2.thrift.port',"10000")
@@ -185,7 +194,14 @@ nagios_web_password = config['configurations']['global']['nagios_web_password']
 user_group = config['configurations']['global']['user_group']
 nagios_contact = config['configurations']['global']['nagios_contact']
 
-namenode_host = default("/clusterHostInfo/namenode_host", None)
+# - test for HDFS or HCFS (glusterfs)
+if 'namenode_host' in config['clusterHostInfo']:
+  namenode_host = default("/clusterHostInfo/namenode_host", None)
+  ishdfs_value = "HDFS"
+else:
+  namenode_host = None
+  ishdfs_value = None 
+
 _snamenode_host = default("/clusterHostInfo/snamenode_host", None)
 _jtnode_host = default("/clusterHostInfo/jtnode_host", None)
 _slave_hosts = default("/clusterHostInfo/slave_hosts", None)
@@ -220,6 +236,8 @@ all_hosts = config['clusterHostInfo']['all_hosts']
 
 if 'namenode_host' in config['clusterHostInfo']:
   nn_hosts_string = " ".join(namenode_host)
+else:
+  nn_hosts_string = " ".join(config['clusterHostInfo']['ambari_server_host'])
 
 
 hostgroup_defs = {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed65cfdd/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
index 0e92dab..3173072 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
@@ -17,14 +17,17 @@
 #}
 
 
-{% if hostgroup_defs['namenode'] or
+
+{% if hostgroup_defs['namenode'] or 
   hostgroup_defs['snamenode']  or
   hostgroup_defs['slaves'] %}
-define servicegroup {
-  servicegroup_name  HDFS
-  alias  HDFS Checks
-}
-{% endif %}
+  {% if hostgroup_defs['namenode'] != None %}
+  define servicegroup {
+    servicegroup_name  HDFS
+    alias  HDFS Checks
+  }
+  {% endif %}
+{% endif %} 
 {%if hostgroup_defs['jobtracker'] or
   hostgroup_defs['historyserver2']-%}
 define servicegroup {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed65cfdd/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 fa45016..aa626bf 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
@@ -64,6 +64,7 @@ define service {
 }
 
 # NAGIOS SERVER HDFS Checks
+{% if hostgroup_defs['namenode'] != None %}
 define service {
         hostgroup_name          nagios-server
         use                     hadoop-service
@@ -85,8 +86,9 @@ define service {
         retry_check_interval    0.25
         max_check_attempts      3
 }
+{% endif %}
 {# used only for HDP2 #}
-{% if hostgroup_defs['namenode'] and dfs_ha_enabled %}
+{% if hostgroup_defs['namenode'] and hostgroup_defs['namenode'] != None and dfs_ha_enabled
%}
 define service {
         hostgroup_name          nagios-server
         use                     hadoop-service
@@ -204,7 +206,7 @@ define service {
 {% endif %}
 
 
-{% if hostgroup_defs['snamenode'] %}
+{% if hostgroup_defs['snamenode'] and hostgroup_defs['namenode'] != None %}
 # Secondary namenode checks
 define service {
         hostgroup_name          snamenode
@@ -313,7 +315,7 @@ define service {
 }
 {%  endif %}
 
-{% if hostgroup_defs['namenode'] %}
+{% if hostgroup_defs['namenode'] and hostgroup_defs['namenode'] != None %}
 # HDFS Checks
 {%  for namenode_hostname in namenode_host %}
 {# TODO: check if we can get rid of str, lower #}
@@ -575,7 +577,7 @@ define service {
 {% endif %}
 {% endif %}
 
-{% if hostgroup_defs['slaves'] %}
+{% if hostgroup_defs['slaves'] and hostgroup_defs['namenode'] != None %}
 # HDFS::DATANODE Checks
 define service {
         hostgroup_name          slaves


Mime
View raw message