Repository: ambari Updated Branches: refs/heads/trunk 37fb051ae -> 491a3284e
AMBARI-13632 Add normalizer properties for AMS Regions (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/491a3284 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/491a3284 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/491a3284 Branch: refs/heads/trunk Commit: 491a3284e26ddb0d2655ccb783f18e88bb75838b Parents: 37fb051 Author: Dmytro Sen <[email protected]> Authored: Fri Oct 30 14:18:08 2015 +0200 Committer: Dmytro Sen <[email protected]> Committed: Fri Oct 30 14:18:25 2015 +0200 ---------------------------------------------------------------------- .../conf/unix/ambari-metrics-collector | 24 ++++++++++++++------ .../0.1.0/configuration/ams-hbase-site.xml | 20 ++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/491a3284/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 dd7ee22..72d4460 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector +++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector @@ -31,7 +31,7 @@ HBASE_CONF_DIR=/etc/ams-hbase/conf HBASE_CMD=${HBASE_DIR}/bin/hbase -METRIC_TABLE_NAME=METRIC_AGGREGATE_DAILY +METRIC_TABLES=(METRIC_AGGREGATE_DAILY METRIC_AGGREGATE_HOURLY METRIC_AGGREGATE METRIC_RECORD METRIC_RECORD_DAILY METRIC_RECORD_HOURLY METRIC_RECORD_MINUTE) METRIC_COLLECTOR=ambari-metrics-collector AMS_LOG_DIR=/var/log/ambari-metrics-collector @@ -82,6 +82,18 @@ function write_pidfile fi } +# TODO replace this with Phoenix DDL, when normalization support added to Phoenix +function enable_normalization +{ + # Enable normalization for all the tables + command="" + for table in "${METRIC_TABLES[@]}" + do + command="$command \n alter_async '$table', {NORMALIZATION_ENABLED => 'true'}" + done + echo -e ${command} | ${HBASE_CMD} --config ${HBASE_CONF_DIR} shell > /dev/null 2>&1 +} + function hadoop_java_setup { # Bail if we did not detect it @@ -201,10 +213,10 @@ function start() echo "Collector successfully started." echo "Initializing Ambari Metrics data model" - # Wait until METRIC_RECORD table created + # Wait until METRIC_* tables created for retry in {1..10} do - echo 'list' | ${HBASE_CMD} --config ${HBASE_CONF_DIR} shell | grep ^${METRIC_TABLE_NAME} > /dev/null 2>&1 + echo 'list' | ${HBASE_CMD} --config ${HBASE_CONF_DIR} shell | grep ^${METRIC_TABLES[0]} > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "Ambari Metrics data model initialization completed." break @@ -216,7 +228,8 @@ function start() exit -1 fi -} + enable_normalization + } function stop() { @@ -331,6 +344,3 @@ case "$1" in ;; esac - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/491a3284/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml index 17f9b81..dfc2878 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml @@ -133,6 +133,26 @@ </description> </property> <property> + <name>hbase.normalizer.enabled</name> + <value>true</value> + <description>If set to true, Master will try to keep region size + within each table approximately the same.</description> + </property> + <property> + <name>hbase.normalizer.period</name> + <value>3600000</value> + <description>Period in ms at which the region normalizer runs in the Master.</description> + </property> + <property> + <name>hbase.master.normalizer.class</name> + <value>org.apache.hadoop.hbase.master.normalizer.SimpleRegionNormalizer</value> + <description> + Class used to execute the region normalization when the period occurs. + See the class comment for more on how it works + http://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.html + </description> + </property> + <property> <name>hfile.block.cache.size</name> <value>0.3</value> <description>
