Repository: ambari Updated Branches: refs/heads/branch-2.1.2 3adbcaa9c -> b2f4a05f8
AMBARI-13149 Ambari Metrics collector failed to start on suse (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b2f4a05f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b2f4a05f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b2f4a05f Branch: refs/heads/branch-2.1.2 Commit: b2f4a05f86b7afd2a89272d478a67a76d38414c8 Parents: 3adbcaa Author: Dmytro Sen <d...@apache.org> Authored: Sat Sep 19 13:46:56 2015 +0300 Committer: Dmytro Sen <d...@apache.org> Committed: Sat Sep 19 13:49:42 2015 +0300 ---------------------------------------------------------------------- .../conf/unix/ambari-metrics-collector | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b2f4a05f/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 fe73ff1..dd7ee22 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector +++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector @@ -29,6 +29,9 @@ DAEMON_NAME=timelineserver COLLECTOR_CONF_DIR=/etc/ambari-metrics-collector/conf HBASE_CONF_DIR=/etc/ams-hbase/conf +HBASE_CMD=${HBASE_DIR}/bin/hbase + +METRIC_TABLE_NAME=METRIC_AGGREGATE_DAILY METRIC_COLLECTOR=ambari-metrics-collector AMS_LOG_DIR=/var/log/ambari-metrics-collector @@ -197,6 +200,22 @@ function start() fi echo "Collector successfully started." + echo "Initializing Ambari Metrics data model" + # Wait until METRIC_RECORD table created + for retry in {1..10} + do + echo 'list' | ${HBASE_CMD} --config ${HBASE_CONF_DIR} shell | grep ^${METRIC_TABLE_NAME} > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "Ambari Metrics data model initialization completed." + break + fi + sleep 5 + done + if [ $? -ne 0 ]; then + echo "Ambari Metrics data model initialization failed." + exit -1 + fi + } function stop()