You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by av...@apache.org on 2016/03/02 21:28:06 UTC
ambari git commit: AMBARI-15270 : Make AMS HBase initialization check
optional through a config (avijayan)
Repository: ambari
Updated Branches:
refs/heads/branch-2.2 1b163eda8 -> 413055b64
AMBARI-15270 : Make AMS HBase initialization check optional through a config (avijayan)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/413055b6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/413055b6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/413055b6
Branch: refs/heads/branch-2.2
Commit: 413055b64ab0c4f3a976e4c447125f4b62f70360
Parents: 1b163ed
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Wed Mar 2 12:25:29 2016 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Wed Mar 2 12:25:34 2016 -0800
----------------------------------------------------------------------
.../conf/unix/ambari-metrics-collector | 50 +++++++++++---------
.../0.1.0/configuration/ams-env.xml | 3 ++
.../0.1.0/configuration/ams-site.xml | 7 +++
.../0.1.0/package/scripts/params.py | 1 +
4 files changed, 39 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/413055b6/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 f9d0e99..9741d34 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
+++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -40,6 +40,7 @@ AMS_COLLECTOR_LOG_DIR=/var/log/ambari-metrics-collector
AMS_HBASE_NORMALIZER_ENABLED=true
AMS_HBASE_FIFO_COMPACTION_ENABLED=true
+AMS_HBASE_INIT_CHECK_ENABLED=true
NORMALIZER_ENABLED_STUB_FILE=/var/run/ambari-metrics-collector/normalizer_enabled
FIFO_ENABLED_STUB_FILE=/var/run/ambari-metrics-collector/fifo_enabled
@@ -283,29 +284,34 @@ function start()
rm -f $STARTUPFILE #Deleting startup file
echo "$(date) Collector successfully started." | tee -a $STARTUPFILE
- echo "$(date) Initializing Ambari Metrics data model" | tee -a $STARTUPFILE
- start=$SECONDS
- # Wait until METRIC_* tables created
- for retry in {1..5}
- do
- echo 'list' | ${HBASE_CMD} --config ${HBASE_CONF_DIR} shell | grep ^${METRIC_TABLES[0]} > /dev/null 2>&1
- if [ $? -eq 0 ]; then
- echo "$(date) Ambari Metrics data model initialization completed." | tee -a $STARTUPFILE
- break
- fi
- echo "$(date) Ambari Metrics data model initialization check $retry" | tee -a $STARTUPFILE
- duration=$(( SECONDS - start ))
- if [ $duration -gt 300 ]; then
- echo "$(date) Ambari Metrics data model initialization timed out" | tee -a $STARTUPFILE
- break
+ if [[ "${AMS_HBASE_INIT_CHECK_ENABLED}" == "true" || "${AMS_HBASE_INIT_CHECK_ENABLED}" == "True" ]]
+ then
+ echo "$(date) Initializing Ambari Metrics data model" | tee -a $STARTUPFILE
+ start=$SECONDS
+ # Wait until METRIC_* tables created
+ for retry in {1..5}
+ do
+ echo 'list' | ${HBASE_CMD} --config ${HBASE_CONF_DIR} shell | grep ^${METRIC_TABLES[0]} > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ echo "$(date) Ambari Metrics data model initialization completed." | tee -a $STARTUPFILE
+ break
+ fi
+ echo "$(date) Ambari Metrics data model initialization check $retry" | tee -a $STARTUPFILE
+ duration=$(( SECONDS - start ))
+ if [ $duration -gt 300 ]; then
+ echo "$(date) Ambari Metrics data model initialization timed out" | tee -a $STARTUPFILE
+ break
+ fi
+ sleep 5
+ done
+ if [ $? -ne 0 ]; then
+ echo "WARNING: Ambari Metrics data model initialization failed."
+ >&2 echo "WARNING: Ambari Metrics data model initialization failed."
+ # else
+ # enable_normalization_fifo
fi
- sleep 5
- done
- if [ $? -ne 0 ]; then
- echo "WARNING: Ambari Metrics data model initialization failed."
- >&2 echo "WARNING: Ambari Metrics data model initialization failed."
-# else
-# enable_normalization_fifo
+ else
+ echo "$(date) Skipping Ambari Metrics data model initialization" | tee -a $STARTUPFILE
fi
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/413055b6/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml
index 9b4689a..896cde3 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml
@@ -91,6 +91,9 @@ export AMS_HBASE_NORMALIZER_ENABLED={{ams_hbase_normalizer_enabled}}
# HBase compaction policy enabled
export AMS_HBASE_FIFO_COMPACTION_ENABLED={{ams_hbase_fifo_compaction_enabled}}
+# HBase Tables Initialization check enabled
+export AMS_HBASE_INIT_CHECK_ENABLED={{ams_hbase_init_check_enabled}}
+
# AMS Collector options
export AMS_COLLECTOR_OPTS="-Djava.library.path=/usr/lib/ams-hbase/lib/hadoop-native"
{% if security_enabled %}
http://git-wip-us.apache.org/repos/asf/ambari/blob/413055b6/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml
index 29a09a8..fd1c2ac 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml
@@ -552,5 +552,12 @@
- HTTPS_ONLY : Service is provided only on https
</description>
</property>
+ <property>
+ <name>timeline.metrics.hbase.init.check.enabled</name>
+ <value>true</value>
+ <description>
+ Enable Initialization check for HBase tables during Metrics service startup.
+ </description>
+ </property>
</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/413055b6/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index 294c025..acc0fcb 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -143,6 +143,7 @@ ams_hbase_home_dir = "/usr/lib/ams-hbase/"
ams_hbase_normalizer_enabled = default("/configurations/ams-hbase-site/hbase.normalizer.enabled", None)
ams_hbase_fifo_compaction_enabled = default("/configurations/ams-site/timeline.metrics.hbase.fifo.compaction.enabled", None)
+ams_hbase_init_check_enabled = default("/configurations/ams-site/timeline.metrics.hbase.init.check.enabled", True)
#hadoop params