ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject git commit: AMBARI-5906. Add support to create arbitrary gmond servers for metrics collection.
Date Wed, 28 May 2014 17:09:06 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ad089e812 -> 9d5a48baa


AMBARI-5906. Add support to create arbitrary gmond servers for metrics collection.


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

Branch: refs/heads/trunk
Commit: 9d5a48baa72ba51b52f0b0178a3aca141758eb79
Parents: ad089e8
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Wed May 28 10:06:25 2014 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Wed May 28 10:08:50 2014 -0700

----------------------------------------------------------------------
 .../GANGLIA/package/scripts/ganglia_monitor.py  | 22 +++++++++
 .../services/GANGLIA/package/scripts/params.py  | 47 +++++++++++++-------
 2 files changed, 52 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9d5a48ba/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
index d3f097f..b9197b5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
@@ -96,6 +96,11 @@ class GangliaMonitor(Script):
     if params.is_ganglia_server_host:
       self.generate_master_configs()
 
+      if len(params.gmond_apps) != 0:
+        self.generate_app_configs()
+        pass
+      pass
+
 
   def generate_slave_configs(self):
     import params
@@ -190,6 +195,23 @@ class GangliaMonitor(Script):
                       group = params.user_group)
 
 
+  def generate_app_configs(self):
+    import params
+
+    for gmond_app in params.gmond_apps:
+      generate_daemon("gmond",
+                      name=gmond_app,
+                      role="server",
+                      owner="root",
+                      group=params.user_group)
+      generate_daemon("gmond",
+                      name = gmond_app,
+                      role = "monitor",
+                      owner = "root",
+                      group = params.user_group)
+    pass
+
+
   def generate_master_configs(self):
     import params
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9d5a48ba/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
index 9bcf54b..3a5bcec 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
@@ -22,7 +22,7 @@ from resource_management.core.system import System
 config = Script.get_config()
 
 user_group = config['configurations']['global']["user_group"]
-ganglia_conf_dir = default("/configurations/global/ganglia_conf_dir","/etc/ganglia/hdp")
+ganglia_conf_dir = default("/configurations/global/ganglia_conf_dir", "/etc/ganglia/hdp")
 ganglia_dir = "/etc/ganglia"
 ganglia_runtime_dir = config['configurations']['global']["ganglia_runtime_dir"]
 ganglia_shell_cmds_dir = "/usr/libexec/hdp/ganglia"
@@ -30,6 +30,12 @@ ganglia_shell_cmds_dir = "/usr/libexec/hdp/ganglia"
 gmetad_user = config['configurations']['global']["gmetad_user"]
 gmond_user = config['configurations']['global']["gmond_user"]
 
+gmond_app_str = default("/configurations/global/enabled_app_servers", None)
+gmond_apps = [] if gmond_app_str is None else gmond_app_str.split(',')
+gmond_apps = [x.strip() for x in gmond_apps]
+gmond_allowed_apps = ["Application1", "Application2", "Application3"]
+gmond_apps = set(gmond_apps) & set(gmond_allowed_apps)
+
 webserver_group = "apache"
 rrdcached_default_base_dir = "/var/lib/ganglia/rrds"
 rrdcached_base_dir = config['configurations']['global']["rrdcached_base_dir"]
@@ -52,9 +58,9 @@ jn_hosts = set(default("/clusterHostInfo/journalnode_hosts", []))
 nimbus_server_hosts = set(default("/clusterHostInfo/nimbus_hosts", []))
 supervisor_server_hosts = set(default("/clusterHostInfo/supervisor_hosts", []))
 
-pure_slave = not hostname in (namenode_host | jtnode_host | rm_host | hs_host |\
-                              hbase_master_hosts |slave_hosts | tt_hosts | hbase_rs_hosts
|\
-                              flume_hosts | nm_hosts | jn_hosts | nimbus_server_hosts |\
+pure_slave = not hostname in (namenode_host | jtnode_host | rm_host | hs_host | \
+                              hbase_master_hosts | slave_hosts | tt_hosts | hbase_rs_hosts
| \
+                              flume_hosts | nm_hosts | jn_hosts | nimbus_server_hosts | \
                               supervisor_server_hosts)
 is_namenode_master = hostname in namenode_host
 is_jtnode_master = hostname in jtnode_host
@@ -86,19 +92,22 @@ has_nimbus_server = not len(nimbus_server_hosts) == 0
 has_supervisor_server = not len(supervisor_server_hosts) == 0
 
 ganglia_cluster_names = {
-  "jtnode_host" : [("HDPJournalNode", 8654)],
-  "flume_hosts" : [("HDPFlumeServer", 8655)],
-  "hbase_rs_hosts" : [("HDPHBaseRegionServer", 8656)],
-  "nm_hosts" : [("HDPNodeManager", 8657)],
-  "mapred_tt_hosts" : [("HDPTaskTracker", 8658)],
-  "slave_hosts" : [("HDPDataNode", 8659), ("HDPSlaves", 8660)],
-  "namenode_host" : [("HDPNameNode", 8661)],
-  "jtnode_host" : [("HDPJobTracker", 8662)],
-  "hbase_master_hosts" : [("HDPHBaseMaster", 8663)],
-  "rm_host" : [("HDPResourceManager", 8664)],
-  "hs_host" : [("HDPHistoryServer", 8666)],
-  "nimbus_hosts" : [("HDPNimbus", 8649)],
-  "supervisor_hosts" : [("HDPSupervisor", 8650)]
+  "jtnode_host": [("HDPJournalNode", 8654)],
+  "flume_hosts": [("HDPFlumeServer", 8655)],
+  "hbase_rs_hosts": [("HDPHBaseRegionServer", 8656)],
+  "nm_hosts": [("HDPNodeManager", 8657)],
+  "mapred_tt_hosts": [("HDPTaskTracker", 8658)],
+  "slave_hosts": [("HDPDataNode", 8659), ("HDPSlaves", 8660)],
+  "namenode_host": [("HDPNameNode", 8661)],
+  "jtnode_host": [("HDPJobTracker", 8662)],
+  "hbase_master_hosts": [("HDPHBaseMaster", 8663)],
+  "rm_host": [("HDPResourceManager", 8664)],
+  "hs_host": [("HDPHistoryServer", 8666)],
+  "nimbus_hosts": [("HDPNimbus", 8649)],
+  "supervisor_hosts": [("HDPSupervisor", 8650)],
+  "Application1": [("Application1", 8667)],
+  "Application2": [("Application2", 8668)],
+  "Application3": [("Application3", 8669)]
 }
 
 ganglia_clusters = []
@@ -109,6 +118,10 @@ for key in ganglia_cluster_names:
   if not len(hosts) == 0:
     for x in ganglia_cluster_names[key]:
       ganglia_clusters.append(x)
+if len(gmond_apps) > 0:
+  for gmond_app in gmond_apps:
+    for x in ganglia_cluster_names[gmond_app]:
+      ganglia_clusters.append(x)
 
 if System.get_instance().os_family == "suse":
   rrd_py_path = '/srv/www/cgi-bin'


Mime
View raw message