瀏覽代碼

AMBARI-21839 METRICS_MONITOR start is failing due to "ImportError: cannot import name _common" (dsen)

Dmytro Sen 8 年之前
父節點
當前提交
9f1331a7df
共有 1 個文件被更改,包括 9 次插入6 次删除
  1. 9 6
      ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor

+ 9 - 6
ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor

@@ -98,23 +98,26 @@ else
   exit 1
 fi
 
+# Set log directory path
+if [[ -n "${AMS_MONITOR_LOG_DIR}" ]]; then
+  OUTFILE=${AMS_MONITOR_LOG_DIR}/ambari-metrics-monitor.out
+fi
+
 #TODO decide if rebuild on each start (pretty quickly) to tolerate major node changes (like kernel update)
 #build psutil
 if [ ! "$(ls -A ${RESOURCE_MONITORING_DIR}/psutil/build)" ]; then
   echo "Building psutil..."
   dir=$(pwd)
   cd "${RESOURCE_MONITORING_DIR}/psutil"
-  ${PYTHON} "setup.py" "build"
+  # build psutil and redirect output to log file
+  echo "--------------------------Building psutil--------------------------" >> ${OUTFILE}
+  ${PYTHON} "setup.py" "build" >> ${OUTFILE}
+  echo "----------------------Finished building psutil---------------------" >> ${OUTFILE}
   cd "${dir}"
 else
   echo "psutil build directory is not empty, continuing..."
 fi
 
-# Set log directory path
-if [[ -n "${AMS_MONITOR_LOG_DIR}" ]]; then
-  OUTFILE=${AMS_MONITOR_LOG_DIR}/ambari-metrics-monitor.out
-fi
-
 # Set pid directory path
 if [[ -n "${AMS_MONITOR_PID_DIR}" ]]; then
   PIDFILE=${AMS_MONITOR_PID_DIR}/ambari-metrics-monitor.pid