ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-13995 Make sure HBase restart with the watch dog thread in embedded and distributed mode (dsen)
Date Fri, 20 Nov 2015 16:49:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d8e97b172 -> c6e946f05


AMBARI-13995 Make sure HBase restart with the watch dog thread in embedded and distributed
mode (dsen)


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

Branch: refs/heads/trunk
Commit: c6e946f052bf77c6af36bc5f7a4dde2b08cb0e71
Parents: d8e97b1
Author: Dmytro Sen <dsen@apache.org>
Authored: Fri Nov 20 18:49:35 2015 +0200
Committer: Dmytro Sen <dsen@apache.org>
Committed: Fri Nov 20 18:49:35 2015 +0200

----------------------------------------------------------------------
 .../conf/unix/ambari-metrics-collector          |  9 ------
 .../0.1.0/package/scripts/metrics_collector.py  |  2 ++
 .../AMBARI_METRICS/test_metrics_collector.py    | 30 ++++++++++++++++++++
 3 files changed, 32 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c6e946f0/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
index 94594d0..25305cf 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
+++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -319,15 +319,6 @@ fi
 case "$1" in
 
 	start)
-    daemon_status "${HBASE_MASTER_PID}"
-    HBASE_DAEMON_STATUS=$?
-    daemon_status "${PIDFILE}"
-    DAEMON_STATUS=$?
-
-    if [[ !"${DISTRIBUTED_HBASE}"  && ( ${DAEMON_STATUS} != 0 || ${HBASE_DAEMON_STATUS}
!= 0 ) ]]; then
-      echo "Stopping already running AMS daemons, if any."
-      stop
-    fi
     start
 
   ;;

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6e946f0/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
index c6e556b..cf498ec 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
@@ -42,6 +42,8 @@ class AmsCollector(Script):
 
   def start(self, env):
     self.configure(env, action = 'start') # for security
+    # stop hanging components before start
+    ams_service('collector', action = 'stop')
     ams_service('collector', action = 'start')
 
   def stop(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6e946f0/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py
b/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py
index f1d60cd..06729a7 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py
@@ -39,6 +39,33 @@ class TestMetricsCollector(RMFTestCase):
     self.assert_hbase_configure('master', distributed=True)
     self.assert_hbase_configure('regionserver', distributed=True)
     self.assert_ams('collector', distributed=True)
+    self.assertResourceCalled('Execute', '/usr/lib/ams-hbase/bin/hbase-daemon.sh --config
/etc/ams-hbase/conf stop zookeeper',
+                              on_timeout = 'ls /var/run/ambari-metrics-collector//hbase-ams-zookeeper.pid
>/dev/null 2>&1 && ps `cat /var/run/ambari-metrics-collector//hbase-ams-zookeeper.pid`
>/dev/null 2>&1 && kill -9 `cat /var/run/ambari-metrics-collector//hbase-ams-zookeeper.pid`',
+                              timeout = 30,
+                              user = 'ams'
+    )
+    self.assertResourceCalled('File', '/var/run/ambari-metrics-collector//hbase-ams-zookeeper.pid',
+                              action = ['delete']
+    )
+    self.assertResourceCalled('Execute', '/usr/lib/ams-hbase/bin/hbase-daemon.sh --config
/etc/ams-hbase/conf stop master',
+                              on_timeout = 'ls /var/run/ambari-metrics-collector//hbase-ams-master.pid
>/dev/null 2>&1 && ps `cat /var/run/ambari-metrics-collector//hbase-ams-master.pid`
>/dev/null 2>&1 && kill -9 `cat /var/run/ambari-metrics-collector//hbase-ams-master.pid`',
+                              timeout = 30,
+                              user = 'ams'
+    )
+    self.assertResourceCalled('File', '/var/run/ambari-metrics-collector//hbase-ams-master.pid',
+                              action = ['delete']
+    )
+    self.assertResourceCalled('Execute', '/usr/lib/ams-hbase/bin/hbase-daemon.sh --config
/etc/ams-hbase/conf stop regionserver',
+                              on_timeout = 'ls /var/run/ambari-metrics-collector//hbase-ams-regionserver.pid
>/dev/null 2>&1 && ps `cat /var/run/ambari-metrics-collector//hbase-ams-regionserver.pid`
>/dev/null 2>&1 && kill -9 `cat /var/run/ambari-metrics-collector//hbase-ams-regionserver.pid`',
+                              timeout = 30,
+                              user = 'ams'
+    )
+    self.assertResourceCalled('File', '/var/run/ambari-metrics-collector//hbase-ams-regionserver.pid',
+                              action = ['delete']
+    )
+    self.assertResourceCalled('Execute', '/usr/sbin/ambari-metrics-collector --config /etc/ambari-metrics-collector/conf
--distributed stop',
+                              user = 'ams'
+    )
     self.assertResourceCalled('Execute', '/usr/lib/ams-hbase/bin/hbase-daemon.sh --config
/etc/ams-hbase/conf start zookeeper',
                               not_if = 'ls /var/run/ambari-metrics-collector//hbase-ams-zookeeper.pid
>/dev/null 2>&1 && ps `cat /var/run/ambari-metrics-collector//hbase-ams-zookeeper.pid`
>/dev/null 2>&1',
                               user = 'ams'
@@ -70,6 +97,9 @@ class TestMetricsCollector(RMFTestCase):
     self.assert_hbase_configure('master')
     self.assert_hbase_configure('regionserver')
     self.assert_ams('collector')
+    self.assertResourceCalled('Execute', '/usr/sbin/ambari-metrics-collector --config /etc/ambari-metrics-collector/conf
stop',
+                              user = 'ams'
+    )
     self.assertResourceCalled('Execute', 'ambari-sudo.sh rm -rf /var/lib/ambari-metrics-collector/hbase-tmp/*.tmp',
     )
     self.assertResourceCalled('Directory', '/var/lib/ambari-metrics-collector/hbase-tmp/zookeeper',


Mime
View raw message