ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [2/2] ambari git commit: AMBARI-9348 AMS: Add support for pid/log directory paths customization (dsen)
Date Tue, 27 Jan 2015 12:40:07 GMT
AMBARI-9348 AMS: Add support for pid/log directory paths customization (dsen)


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

Branch: refs/heads/trunk
Commit: 97de6e8c40d9cb67de5a34c69ba9c5be43f35cb6
Parents: 02190c4
Author: Dmytro Sen <dsen@apache.org>
Authored: Tue Jan 27 12:16:55 2015 +0200
Committer: Dmytro Sen <dsen@apache.org>
Committed: Tue Jan 27 14:36:08 2015 +0200

----------------------------------------------------------------------
 ambari-metrics/ambari-metrics-assembly/pom.xml  | 16 -------------
 .../conf/unix/ambari-metrics-collector          | 10 ++++++--
 .../ambari-metrics-timelineservice/pom.xml      |  6 -----
 .../AMS/0.1.0/configuration/ams-env.xml         | 25 +++++++++++---------
 .../alerts/alert_ambari_metrics_monitor.py      | 11 ++++++---
 5 files changed, 30 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/97de6e8c/ambari-metrics/ambari-metrics-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-assembly/pom.xml b/ambari-metrics/ambari-metrics-assembly/pom.xml
index 6236187..4b5503e 100644
--- a/ambari-metrics/ambari-metrics-assembly/pom.xml
+++ b/ambari-metrics/ambari-metrics-assembly/pom.xml
@@ -264,12 +264,6 @@
                       <configuration>true</configuration>
                     </mapping>
                     <mapping>
-                      <directory>/var/run/ambari-metrics-monitor</directory>
-                    </mapping>
-                    <mapping>
-                      <directory>/var/log/ambari-metrics-monitor</directory>
-                    </mapping>
-                    <mapping>
                       <directory>/usr/sbin</directory>
                       <filemode>755</filemode>
                       <username>root</username>
@@ -406,12 +400,6 @@
                       <directory>/var/run/ams-hbase</directory>
                     </mapping>
                     <mapping>
-                      <directory>/var/run/ambari-metrics-collector</directory>
-                    </mapping>
-                    <mapping>
-                      <directory>/var/log/ambari-metrics-collector</directory>
-                    </mapping>
-                    <mapping>
                       <directory>/var/lib/ambari-metrics-collector</directory>
                     </mapping>
                   </mappings>
@@ -602,15 +590,11 @@
                 <data>
                   <type>template</type>
                   <paths>
-                    <path>/var/run/ambari-metrics-monitor</path>
-                    <path>/var/log/ambari-metrics-monitor</path>
                     <path>/etc/ambari-metrics-monitor/conf</path>
                     <path>/usr/lib/ambari-metrics-collector</path>
                     <path>/etc/ambari-metrics-collector/conf</path>
                     <path>/etc/ams-hbase/conf</path>
-                    <path>/var/run/ambari-metrics-collector</path>
                     <path>/var/run/ams-hbase</path>
-                    <path>/var/log/ambari-metrics-collector</path>
                     <path>/var/lib/ambari-metrics-collector</path>
                     <path>/usr/lib/ambari-metrics-hadoop-sink</path>
                     <path>/usr/lib/ambari-metrics-kafka-sink</path>

http://git-wip-us.apache.org/repos/asf/ambari/blob/97de6e8c/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 4d6eed7..bdbb107 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
+++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -177,8 +177,14 @@ else
 fi
 
 # set pid dir path
-if [[ -n "${AMS_PID_DIR}" ]]; then
-  PIDFILE=${AMS_PID_DIR}/ambari-metrics-collector.pid
+if [[ -n "${AMS_COLLECTOR_PID_DIR}" ]]; then
+  PIDFILE=${AMS_COLLECTOR_PID_DIR}/ambari-metrics-collector.pid
+fi
+
+if [[ -n "${AMS_HBASE_PID_DIR}" ]]; then
+  HBASE_ZK_PID=${AMS_HBASE_PID_DIR}/hbase-hbase-zookeeper.pid
+  HBASE_MASTER_PID=${AMS_HBASE_PID_DIR}/hbase-hbase-master.pid
+  HBASE_RS_PID=${AMS_HBASE_PID_DIR}/hbase-hbase-regionserver.pid
 fi
 
 # set out file path

http://git-wip-us.apache.org/repos/asf/ambari/blob/97de6e8c/ambari-metrics/ambari-metrics-timelineservice/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index 46504a7..59261ab 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -239,12 +239,6 @@
               <directory>/var/run/ams-hbase</directory>
             </mapping>
             <mapping>
-              <directory>/var/run/ambari-metrics-collector</directory>
-            </mapping>
-            <mapping>
-              <directory>/var/log/ambari-metrics-collector</directory>
-            </mapping>
-            <mapping>
               <directory>/var/lib/ambari-metrics-collector</directory>
             </mapping>
           </mappings>

http://git-wip-us.apache.org/repos/asf/ambari/blob/97de6e8c/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml
b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml
index 48fffb3..8e09cc5 100644
--- a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml
@@ -49,22 +49,25 @@
   <property>
     <name>content</name>
     <value>
-      # Set environment variables here.
+# Set environment variables here.
 
-      # The java implementation to use. Java 1.6 required.
-      export JAVA_HOME={{java64_home}}
+# The java implementation to use. Java 1.6 required.
+export JAVA_HOME={{java64_home}}
 
-      # Collector Log directory for log4j
-      export AMS_COLLECTOR_LOG_DIR={{ams_collector_log_dir}}
+# Collector Log directory for log4j
+export AMS_COLLECTOR_LOG_DIR={{ams_collector_log_dir}}
 
-      # Monitor Log directory for outfile
-      export AMS_MONITOR_LOG_DIR={{ams_monitor_log_dir}}
+# Monitor Log directory for outfile
+export AMS_MONITOR_LOG_DIR={{ams_monitor_log_dir}}
 
-      # Collector pid directory
-      export AMS_COLLECTOR_PID_DIR={{ams_collector_pid_dir}}
+# Collector pid directory
+export AMS_COLLECTOR_PID_DIR={{ams_collector_pid_dir}}
 
-      # Monitor pid directory
-      export AMS_MONITOR_PID_DIR={{ams_monitor_pid_dir}}
+# Monitor pid directory
+export AMS_MONITOR_PID_DIR={{ams_monitor_pid_dir}}
+
+# AMS HBase pid directory
+export AMS_HBASE_PID_DIR={{hbase_pid_dir}}
     </value>
   </property>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/97de6e8c/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/alerts/alert_ambari_metrics_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/alerts/alert_ambari_metrics_monitor.py
b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/alerts/alert_ambari_metrics_monitor.py
index 5841267..40f8c60 100644
--- a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/alerts/alert_ambari_metrics_monitor.py
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/alerts/alert_ambari_metrics_monitor.py
@@ -18,6 +18,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 """
 
+import os
 import socket
 
 from resource_management.libraries.functions.check_process_status import check_process_status
@@ -27,15 +28,14 @@ RESULT_CODE_OK = 'OK'
 RESULT_CODE_CRITICAL = 'CRITICAL'
 RESULT_CODE_UNKNOWN = 'UNKNOWN'
 
-AMS_MONITOR_PID_PATH = '/var/run/ambari-metrics-monitor/ambari-metrics-monitor.pid'
-
+AMS_MONITOR_PID_DIR = '{{ams-env/ams_monitor_pid_dir}}'
 
 def get_tokens():
   """
   Returns a tuple of tokens in the format {{site/property}} that will be used
   to build the dictionary passed into execute
   """
-  return ()
+  return (AMS_MONITOR_PID_DIR,)
 
 
 def is_monitor_process_live(pid_file):
@@ -67,6 +67,11 @@ def execute(parameters=None, host_name=None):
   if parameters is None:
     return (RESULT_CODE_UNKNOWN, ['There were no parameters supplied to the script.'])
 
+  if set([AMS_MONITOR_PID_DIR]).issubset(parameters):
+    AMS_MONITOR_PID_PATH = os.path.join(parameters[AMS_MONITOR_PID_DIR], 'ambari-metrics-monitor.pid')
+  else:
+    return (RESULT_CODE_UNKNOWN, ['The ams_monitor_pid_dir is a required parameter.'])
+
   if host_name is None:
     host_name = socket.getfqdn()
 


Mime
View raw message