فهرست منبع

AMBARI-20219 : Grafana Start Failed on HDF cluster. (avijayan)

Aravindan Vijayan 8 سال پیش
والد
کامیت
4fd5665553

+ 13 - 4
ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana

@@ -94,7 +94,7 @@ function isRunning() {
 
 case "$1" in
   start)
-    echo $"Starting $DESC: .... " >> $LOG_FILE
+    echo $"$(date) Starting $DESC: .... " >> $LOG_FILE
 
     isRunning
     if [ $? -eq 0 ]; then
@@ -116,10 +116,19 @@ case "$1" in
     return=$?
     if [ $return -eq 0 ]
     then
-      sleep 5
-      # check if pid file has been written two
+      for i in {1..10}
+      do
+        sleep 2
+        # check if pid file has been written to
+        if [ -s $PID_FILE ]; then
+          echo " $(date) pid_file has been written to" >> $LOG_FILE
+          break
+        else
+          echo " $(date) pid_file not yet written to" >> $LOG_FILE
+        fi
+      done
       if ! [[ -s $PID_FILE ]]; then
-        echo "Start FAILED because daemon did not write pid in pid_file" >> $LOG_FILE
+        echo " $(date) Start FAILED because daemon did not write pid in pid_file after 20 seconds" >> $LOG_FILE
         exit 1
       fi
       i=0

+ 8 - 2
ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java

@@ -467,6 +467,12 @@ public class TimelineMetricConfiguration {
     Set<String> whitelist = new HashSet<>();
 
     try(InputStream inputStream = classLoader.getResourceAsStream(AMSHBASE_METRICS_WHITESLIST_FILE)) {
+
+      if (inputStream == null) {
+        LOG.info("ams-hbase metrics whitelist file not present.");
+        return Collections.EMPTY_SET;
+      }
+
       br = new BufferedReader(new InputStreamReader(inputStream));
 
       while ((strLine = br.readLine()) != null)   {
@@ -476,8 +482,8 @@ public class TimelineMetricConfiguration {
         }
         whitelist.add(strLine);
       }
-    } catch (IOException ioEx) {
-      LOG.error("Unable to parse ams-hbase metric whitelist file", ioEx);
+    } catch (Exception ex) {
+      LOG.error("Unable to read ams-hbase metric whitelist file", ex);
       return Collections.EMPTY_SET;
     }