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-20219 : Grafana Start Failed on HDF cluster. (avijayan)
Date Tue, 28 Feb 2017 01:26:58 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 9112148e5 -> f5f9b760b


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


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

Branch: refs/heads/trunk
Commit: f5f9b760be9c37c4bac4758afedd101cddcd00ca
Parents: 9112148
Author: Aravindan Vijayan <avijayan@hortonworks.com>
Authored: Mon Feb 27 17:26:28 2017 -0800
Committer: Aravindan Vijayan <avijayan@hortonworks.com>
Committed: Mon Feb 27 17:26:28 2017 -0800

----------------------------------------------------------------------
 .../conf/unix/ambari-metrics-grafana               | 17 +++++++++++++----
 .../timeline/TimelineMetricConfiguration.java      | 10 ++++++++--
 2 files changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f5f9b760/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana b/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
index 8a8ac8f..dba2f5f 100644
--- a/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
+++ b/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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f5f9b760/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
index 72e895d..80d451e 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
@@ -470,6 +470,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)   {
@@ -479,8 +485,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;
     }
 


Mime
View raw message