ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject git commit: AMBARI-4939. Ganglia alerts after adding YARN+MR2. (Dmytro Shkvyra via mahadev)
Date Wed, 05 Mar 2014 19:49:05 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 221c8215a -> aec54e2c2


AMBARI-4939. Ganglia alerts after adding YARN+MR2. (Dmytro Shkvyra via mahadev)


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

Branch: refs/heads/trunk
Commit: aec54e2c2b95ba1aab133a3bc1a5e53898b208c6
Parents: 221c821
Author: Mahadev Konar <mahadev@apache.org>
Authored: Wed Mar 5 11:48:04 2014 -0800
Committer: Mahadev Konar <mahadev@apache.org>
Committed: Wed Mar 5 11:48:08 2014 -0800

----------------------------------------------------------------------
 .../GANGLIA/package/scripts/ganglia_monitor.py  |   3 +
 .../GANGLIA/package/scripts/ganglia_monitor.py  |   3 +
 .../1.3.2/GANGLIA/test_ganglia_monitor.py       | 200 ++++++++++++++++++-
 .../2.0.6/GANGLIA/test_ganglia_monitor.py       | 166 ++++++++++++++-
 4 files changed, 360 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/aec54e2c/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
index 50943c4..4b825b4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
@@ -34,6 +34,9 @@ class GangliaMonitor(Script):
     self.configure(env)
 
   def start(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env)   
     ganglia_monitor_service.monitor("start")
 
   def stop(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/aec54e2c/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 3ce3623..6f9bc40 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
@@ -34,6 +34,9 @@ class GangliaMonitor(Script):
     self.configure(env)
 
   def start(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env)
     ganglia_monitor_service.monitor("start")
 
   def stop(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/aec54e2c/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py b/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py
index 7563e04..5127906 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py
@@ -188,14 +188,202 @@ class TestGangliaMonitor(RMFTestCase):
                        command="start",
                        config_file="default.json"
     )
-    self.assertResourceCalled('Execute', 'chkconfig gmond off',
-                              path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
-                              )
-    self.assertResourceCalled('Execute', 'service hdp-gmond start >> /tmp/gmond.log
 2>&1 ; /bin/ps auwx | /bin/grep [g]mond  >> /tmp/gmond.log  2>&1',
-                              path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
-                              )
+    self.assertResourceCalled(
+        'Group', 'hadoop',
+        )
+    self.assertResourceCalled(
+        'Group', 'nobody',
+        )
+    self.assertResourceCalled(
+        'Group', 'nobody',
+        )
+    self.assertResourceCalled(
+        'User', 'nobody',
+        groups = [u'nobody'],
+        )
+    self.assertResourceCalled(
+        'User', 'nobody',
+        groups = [u'nobody'],
+        )
+    self.assertResourceCalled(
+        'Directory', '/etc/ganglia/hdp',
+        owner = 'root',
+        group = 'hadoop',
+        recursive = True,
+        )
+    self.assertResourceCalled(
+        'Directory', '/usr/libexec/hdp/ganglia',
+        owner = 'root',
+        group = 'root',
+        recursive = True,
+        )
+    self.assertResourceCalled(
+        'File', '/etc/init.d/hdp-gmetad',
+        content = StaticFile('gmetad.init'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/etc/init.d/hdp-gmond',
+        content = StaticFile('gmond.init'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/checkGmond.sh',
+        content = StaticFile('checkGmond.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/checkRrdcached.sh',
+        content = StaticFile('checkRrdcached.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/gmetadLib.sh',
+        content = StaticFile('gmetadLib.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/gmondLib.sh',
+        content = StaticFile('gmondLib.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/rrdcachedLib.sh',
+        content = StaticFile('rrdcachedLib.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/setupGanglia.sh',
+        content = StaticFile('setupGanglia.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/startGmetad.sh',
+        content = StaticFile('startGmetad.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/startGmond.sh',
+        content = StaticFile('startGmond.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/startRrdcached.sh',
+        content = StaticFile('startRrdcached.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/stopGmetad.sh',
+        content = StaticFile('stopGmetad.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/stopGmond.sh',
+        content = StaticFile('stopGmond.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/stopRrdcached.sh',
+        content = StaticFile('stopRrdcached.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/teardownGanglia.sh',
+        content = StaticFile('teardownGanglia.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaClusters.conf',
+        owner = 'root',
+        template_tag = None,
+        group = 'root',
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaEnv.sh',
+        owner = 'root',
+        template_tag = None,
+        group = 'root',
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaLib.sh',
+        owner = 'root',
+        template_tag = None,
+        group = 'root',
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPJobTracker -o root -g
hadoop',
+        path = ['/usr/libexec/hdp/ganglia',
+                '/usr/sbin',
+                '/sbin:/usr/local/bin',
+                '/bin',
+                '/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHistoryServer -o root
-g hadoop',
+        path = ['/usr/libexec/hdp/ganglia',
+                '/usr/sbin',
+                '/sbin:/usr/local/bin',
+                '/bin',
+                '/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPDataNode -o root -g hadoop',
+        path = ['/usr/libexec/hdp/ganglia',
+                '/usr/sbin',
+                '/sbin:/usr/local/bin',
+                '/bin',
+                '/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPTaskTracker -o root -g
hadoop',
+        path = ['/usr/libexec/hdp/ganglia',
+                '/usr/sbin',
+                '/sbin:/usr/local/bin',
+                '/bin',
+                '/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseRegionServer -o root
-g hadoop',
+        path = ['/usr/libexec/hdp/ganglia',
+                '/usr/sbin',
+                '/sbin:/usr/local/bin',
+                '/bin',
+                '/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Directory', '/etc/ganglia/conf.d',
+        owner = 'root',
+        group = 'hadoop',
+        )
+    self.assertResourceCalled(
+        'File', '/etc/ganglia/conf.d/modgstatus.conf',
+        owner = 'root',
+        group = 'hadoop',
+        )
+    self.assertResourceCalled(
+        'File', '/etc/ganglia/conf.d/multicpu.conf',
+        owner = 'root',
+        group = 'hadoop',
+        )
+    self.assertResourceCalled(
+        'File', '/etc/ganglia/gmond.conf',
+        owner = 'root',
+        group = 'hadoop',
+        )
+    self.assertResourceCalled(
+        'Execute', 'chkconfig gmond off',
+        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Execute', 'service hdp-gmond start >> /tmp/gmond.log  2>&1 ; /bin/ps
auwx | /bin/grep [g]mond  >> /tmp/gmond.log  2>&1',
+        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
+        )
     self.assertNoMoreResources()
 
+
   def test_stop_default(self):
     self.executeScript("1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py",
                        classname="GangliaMonitor",

http://git-wip-us.apache.org/repos/asf/ambari/blob/aec54e2c/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
index 50a2ea9..52aff88 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
@@ -162,12 +162,166 @@ class TestGangliaMonitor(RMFTestCase):
                        command="start",
                        config_file="default.json"
     )
-    self.assertResourceCalled('Execute', 'chkconfig gmond off',
-                              path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
-                              )
-    self.assertResourceCalled('Execute', 'service hdp-gmond start >> /tmp/gmond.log
 2>&1 ; /bin/ps auwx | /bin/grep [g]mond  >> /tmp/gmond.log  2>&1',
-                              path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
-                              )
+    self.assertResourceCalled(
+        'Directory', '/etc/ganglia/hdp',
+        owner = 'root',
+        group = 'hadoop',
+        recursive = True,
+        )
+    self.assertResourceCalled(
+        'Directory', '/usr/libexec/hdp/ganglia',
+        owner = 'root',
+        group = 'root',
+        recursive = True,
+        )
+    self.assertResourceCalled(
+        'File', '/etc/init.d/hdp-gmetad',
+        content = StaticFile('gmetad.init'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/etc/init.d/hdp-gmond',
+        content = StaticFile('gmond.init'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/checkGmond.sh',
+        content = StaticFile('checkGmond.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/checkRrdcached.sh',
+        content = StaticFile('checkRrdcached.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/gmetadLib.sh',
+        content = StaticFile('gmetadLib.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/gmondLib.sh',
+        content = StaticFile('gmondLib.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/rrdcachedLib.sh',
+        content = StaticFile('rrdcachedLib.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/setupGanglia.sh',
+        content = StaticFile('setupGanglia.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/startGmetad.sh',
+        content = StaticFile('startGmetad.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/startGmond.sh',
+        content = StaticFile('startGmond.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/startRrdcached.sh',
+        content = StaticFile('startRrdcached.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/stopGmetad.sh',
+        content = StaticFile('stopGmetad.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/stopGmond.sh',
+        content = StaticFile('stopGmond.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/stopRrdcached.sh',
+        content = StaticFile('stopRrdcached.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'File', '/usr/libexec/hdp/ganglia/teardownGanglia.sh',
+        content = StaticFile('teardownGanglia.sh'),
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaClusters.conf',
+        owner = 'root',
+        template_tag = None,
+        group = 'root',
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaEnv.sh',
+        owner = 'root',
+        template_tag = None,
+        group = 'root',
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaLib.sh',
+        owner = 'root',
+        template_tag = None,
+        group = 'root',
+        mode = 0755,
+        )
+    self.assertResourceCalled(
+        'Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNameNode -o root -g hadoop',
+        path = ['/usr/libexec/hdp/ganglia',
+                '/usr/sbin',
+                '/sbin:/usr/local/bin',
+                '/bin',
+                '/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNimbus -o root -g hadoop',
+        path = ['/usr/libexec/hdp/ganglia',
+                '/usr/sbin',
+                '/sbin:/usr/local/bin',
+                '/bin',
+                '/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPSupervisor -o root -g
hadoop',
+        path = ['/usr/libexec/hdp/ganglia',
+                '/usr/sbin',
+                '/sbin:/usr/local/bin',
+                '/bin',
+                '/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Directory', '/etc/ganglia/conf.d',
+        owner = 'root',
+        group = 'hadoop',
+        )
+    self.assertResourceCalled(
+        'File', '/etc/ganglia/conf.d/modgstatus.conf',
+        owner = 'root',
+        group = 'hadoop',
+        )
+    self.assertResourceCalled(
+        'File', '/etc/ganglia/conf.d/multicpu.conf',
+        owner = 'root',
+        group = 'hadoop',
+        )
+    self.assertResourceCalled(
+        'File', '/etc/ganglia/gmond.conf',
+        owner = 'root',
+        group = 'hadoop',
+        )
+    self.assertResourceCalled(
+        'Execute', 'chkconfig gmond off',
+        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
+        )
+    self.assertResourceCalled(
+        'Execute', 'service hdp-gmond start >> /tmp/gmond.log  2>&1 ; /bin/ps
auwx | /bin/grep [g]mond  >> /tmp/gmond.log  2>&1',
+        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
+        )
     self.assertNoMoreResources()
 
   def test_stop_default(self):


Mime
View raw message