ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avija...@apache.org
Subject ambari git commit: AMBARI-15270 : Make AMS HBase initialization check optional through a config (avijayan)
Date Wed, 02 Mar 2016 20:35:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4ecb3c10f -> eb166d6f5


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/eb166d6f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/eb166d6f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/eb166d6f

Branch: refs/heads/trunk
Commit: eb166d6f55be1115c73c41cae84f7c3c92d0ee28
Parents: 4ecb3c1
Author: Aravindan Vijayan <avijayan@hortonworks.com>
Authored: Wed Mar 2 12:35:01 2016 -0800
Committer: Aravindan Vijayan <avijayan@hortonworks.com>
Committed: Wed Mar 2 12:35:01 2016 -0800

----------------------------------------------------------------------
 .../conf/unix/ambari-metrics-collector          | 46 +++++++++++---------
 .../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, 37 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eb166d6f/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 a08c7b6..4fab821 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,28 +284,33 @@ 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
+  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."
     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
+    else
+      echo "$(date) Skipping Ambari Metrics data model initialization" | tee -a $STARTUPFILE
     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."
-  fi
   }
 
 function stop()

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb166d6f/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 609594a..78b8999 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
@@ -107,6 +107,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/eb166d6f/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 08bf47c..0022607 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
@@ -563,5 +563,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/eb166d6f/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
 


Mime
View raw message