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-14078 Metrics Collector startup is slow in Kerberized environment (dsen)
Date Thu, 26 Nov 2015 11:53:16 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 0585b5af5 -> f4b86a561


AMBARI-14078 Metrics Collector startup is slow in Kerberized environment (dsen)


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

Branch: refs/heads/branch-2.1
Commit: f4b86a5615e0774528fba7e5f68ac299a3f49600
Parents: 0585b5a
Author: Dmytro Sen <dsen@apache.org>
Authored: Thu Nov 26 13:49:41 2015 +0200
Committer: Dmytro Sen <dsen@apache.org>
Committed: Thu Nov 26 13:51:14 2015 +0200

----------------------------------------------------------------------
 .../conf/unix/ambari-metrics-collector               | 15 +++++++++++----
 .../0.1.0/package/scripts/ams_service.py             |  8 +++++++-
 2 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f4b86a56/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 25305cf..52fe9ea 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
+++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -195,7 +195,7 @@ function start()
     rm -f "${PIDFILE}" >/dev/null 2>&1
   fi
 
-  nohup "${JAVA}" "-Xms$AMS_COLLECTOR_HEAPSIZE" "-Xmx$AMS_COLLECTOR_HEAPSIZE" "${AMS_COLLECTOR_OPTS}"
"-cp" "/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}" "-Djava.net.preferIPv4Stack=true"
"-Dams.log.dir=${AMS_COLLECTOR_LOG_DIR}" "-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" > $OUTFILE
2>&1 &
+  nohup "${JAVA}" "-Xms$AMS_COLLECTOR_HEAPSIZE" "-Xmx$AMS_COLLECTOR_HEAPSIZE" "${AMS_COLLECTOR_OPTS}"
"-cp" "/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}" "-Djava.net.preferIPv4Stack=true"
"-Dams.log.dir=${AMS_COLLECTOR_LOG_DIR}" "-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" >>
$OUTFILE 2>&1 &
   PID=$!
   write_pidfile "${PIDFILE}"
   sleep 2
@@ -215,14 +215,21 @@ function start()
     exit -1
   fi
 
-  echo "Collector successfully started."
-  echo "Initializing Ambari Metrics data model"
+  echo "$(date) Collector successfully started." | tee -a $OUTFILE
+  echo "$(date) Initializing Ambari Metrics data model" | tee -a $OUTFILE
+  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 "Ambari Metrics data model initialization completed."
+      echo "$(date) Ambari Metrics data model initialization completed." | tee -a $OUTFILE
+      break
+    fi
+    echo "$(date) Ambari Metrics data model initialization check $retry" | tee -a $OUTFILE
+    duration=$(( SECONDS - start ))
+    if [ $duration -gt 300 ]; then
+      echo "$(date) Ambari Metrics data model initialization timed out" | tee -a $OUTFILE
       break
     fi
     sleep 5

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4b86a56/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
index 2b475dd..0726802 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
@@ -59,7 +59,13 @@ def ams_service(name, action):
                   action='delete'
         )
 
-      daemon_cmd = format("{cmd} start")
+
+      if params.security_enabled:
+        kinit_cmd = format("{kinit_path_local} -kt {ams_collector_keytab_path} {ams_collector_jaas_princ};")
+        daemon_cmd = format("{kinit_cmd} {cmd} start")
+      else:
+        daemon_cmd = format("{cmd} start")
+
       Execute(daemon_cmd,
               user=params.ams_user
       )


Mime
View raw message