ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avija...@apache.org
Subject [1/2] ambari git commit: AMBARI-19887 : Add AMS and Grafana to PERF cluster (Addendum patch) (avijayan)
Date Thu, 09 Feb 2017 21:46:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 3c0f3c46b -> 05ce603a9


AMBARI-19887 : Add AMS and Grafana to PERF cluster (Addendum patch) (avijayan)


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

Branch: refs/heads/trunk
Commit: 7abf4e63f093d55c793b451d0435fc485757e6c7
Parents: 3c0f3c4
Author: Aravindan Vijayan <avijayan@hortonworks.com>
Authored: Thu Feb 9 13:45:33 2017 -0800
Committer: Aravindan Vijayan <avijayan@hortonworks.com>
Committed: Thu Feb 9 13:45:33 2017 -0800

----------------------------------------------------------------------
 .../0.1.0/package/scripts/params.py             |  6 +++---
 .../PERF/1.0/hooks/before-ANY/scripts/hook.py   |  6 ++++--
 .../PERF/1.0/hooks/before-ANY/scripts/params.py |  2 ++
 .../1.0/hooks/before-INSTALL/scripts/hook.py    |  1 +
 .../1.0/hooks/before-RESTART/scripts/hook.py    |  1 +
 .../1.0/services/AMBARI_METRICS/metainfo.xml    | 20 ++++++++++++++++++++
 6 files changed, 31 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7abf4e63/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index dcc26b7..fcfe088 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -67,9 +67,9 @@ if not is_ams_distributed and len(ams_collector_list) > 1:
 
 if 'cluster-env' in config['configurations'] and \
     'metrics_collector_vip_host' in config['configurations']['cluster-env']:
-  metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
-else:
-  metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
+  ams_collector_hosts = config['configurations']['cluster-env']['metrics_collector_vip_host']
+
+metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
 
 random_metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7abf4e63/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
index ef409e2..d707c3b 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
@@ -28,8 +28,10 @@ class BeforeAnyHook(Hook):
     env.set_params(params)
 
     #For AMS.
-    setup_users()
-    setup_java()
+    if params.service_name == 'AMBARI_METRICS':
+      setup_users()
+      if params.component_name == 'METRICS_COLLECTOR':
+        setup_java()
 
 if __name__ == "__main__":
   BeforeAnyHook().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/7abf4e63/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py
b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py
index dee9d07..2c2c901 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py
@@ -39,4 +39,6 @@ artifact_dir = format("{tmp_dir}/AMBARI-artifacts/")
 jdk_location = config['hostLevelParams']['jdk_location']
 java_version = expect("/hostLevelParams/java_version", int)
 
+service_name = config["serviceName"]
+component_name = config["role"]
 sudo = AMBARI_SUDO_BINARY
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/7abf4e63/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
index f030cfc..833fdbc 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
@@ -35,6 +35,7 @@ CONF_SELECT_DEST = "/usr/bin/conf-select"
 class BeforeInstallHook(Hook):
 
   def hook(self, env):
+    self.run_custom_hook('before-ANY')
     print "Before Install Hook"
     cache_dir = self.extrakt_var_from_pythonpath(AMBARI_AGENT_CACHE_DIR)
     conf_select = os.path.join(cache_dir, CONF_SELECT_PY)

http://git-wip-us.apache.org/repos/asf/ambari/blob/7abf4e63/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py
b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py
index a366129..301288b 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py
@@ -22,6 +22,7 @@ from resource_management.libraries.script import Hook
 class BeforeRestartHook(Hook):
 
   def hook(self, env):
+    self.run_custom_hook('before-START')
     print "Before Restart Hook"
 
 if __name__ == "__main__":

http://git-wip-us.apache.org/repos/asf/ambari/blob/7abf4e63/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml
index 03a5ab5..a06e61d 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml
@@ -21,6 +21,26 @@
         <service>
             <name>AMBARI_METRICS</name>
             <extends>common-services/AMBARI_METRICS/0.1.0</extends>
+            <components>
+                <component>
+                    <name>METRICS_MONITOR</name>
+                    <displayName>Metrics Monitor</displayName>
+                    <category>SLAVE</category>
+                    <cardinality>0+</cardinality>
+                    <versionAdvertised>false</versionAdvertised>
+                    <commandScript>
+                        <script>scripts/metrics_monitor.py</script>
+                        <scriptType>PYTHON</scriptType>
+                        <timeout>1200</timeout>
+                    </commandScript>
+                    <logs>
+                        <log>
+                            <logId>ams_monitor</logId>
+                            <primary>true</primary>
+                        </log>
+                    </logs>
+                </component>
+            </components>
         </service>
     </services>
 </metainfo>
\ No newline at end of file


Mime
View raw message