ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject git commit: AMBARI-4090. Fix Mapreduce2 status commands for HS, RM, NM not implemented (Arsen Babych via aonishuk)
Date Tue, 17 Dec 2013 16:54:23 GMT
Updated Branches:
  refs/heads/trunk 185b11ab5 -> 4522c0d1b


AMBARI-4090. Fix Mapreduce2 status commands for HS,RM,NM not implemented
(Arsen Babych via aonishuk)


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

Branch: refs/heads/trunk
Commit: 4522c0d1bc40ed55b8d3fe39e6be9cbf39a7955a
Parents: 185b11a
Author: Andrew Onischuk <aonishuk@hortonworks.com>
Authored: Tue Dec 17 08:53:16 2013 -0800
Committer: Andrew Onischuk <aonishuk@hortonworks.com>
Committed: Tue Dec 17 08:53:16 2013 -0800

----------------------------------------------------------------------
 .../YARN/package/scripts/historyserver.py       |  5 +++
 .../YARN/package/scripts/nodemanager.py         |  5 +++
 .../services/YARN/package/scripts/params.py     | 13 ++++----
 .../YARN/package/scripts/resourcemanager.py     |  5 +++
 .../YARN/package/scripts/status_params.py       | 34 ++++++++++++++++++++
 5 files changed, 56 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4522c0d1/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/historyserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/historyserver.py
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/historyserver.py
index 9f757a0..9b6003c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/historyserver.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/historyserver.py
@@ -51,5 +51,10 @@ class Histroryserver(Script):
             action='stop'
     )
 
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    check_process_status(status_params.histroyserver_pid_file)
+
 if __name__ == "__main__":
   Histroryserver().execute()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4522c0d1/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/nodemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/nodemanager.py
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/nodemanager.py
index a2a6308..dbeaca0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/nodemanager.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/nodemanager.py
@@ -52,5 +52,10 @@ class Nodemanager(Script):
             action='stop'
     )
 
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    check_process_status(status_params.nodemanager_pid_file)
+
 if __name__ == "__main__":
   Nodemanager().execute()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4522c0d1/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/params.py
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/params.py
index 4b09d8c..b5dd926 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/params.py
@@ -21,14 +21,15 @@ Ambari Agent
 """
 
 from resource_management import *
+import status_params
 
 # server configurations
 config = Script.get_config()
 
 config_dir = "/etc/hadoop/conf"
 
-mapred_user = config['configurations']['global']['mapred_user']
-yarn_user = config['configurations']['global']['yarn_user']
+mapred_user = status_params.mapred_user
+yarn_user = status_params.yarn_user
 hdfs_user = config['configurations']['global']['hdfs_user']
 
 smokeuser = config['configurations']['global']['smokeuser']
@@ -50,8 +51,8 @@ resourcemanager_heapsize = config['configurations']['global']['resourcemanager_h
 nodemanager_heapsize = config['configurations']['global']['nodemanager_heapsize']
 
 yarn_log_dir_prefix = config['configurations']['global']['yarn_log_dir_prefix']
-yarn_pid_dir_prefix = config['configurations']['global']['yarn_pid_dir_prefix']
-mapred_pid_dir_prefix = config['configurations']['global']['mapred_pid_dir_prefix']
+yarn_pid_dir_prefix = status_params.yarn_pid_dir_prefix
+mapred_pid_dir_prefix = status_params.mapred_pid_dir_prefix
 mapred_log_dir_prefix = config['configurations']['global']['mapred_log_dir_prefix']
 
 rm_webui_address = format("{rm_host}:{rm_port}")
@@ -67,8 +68,8 @@ hadoop_mapred2_jar_location = "/usr/lib/hadoop-mapreduce"
 distrAppJarName = "hadoop-yarn-applications-distributedshell-2.*.jar"
 hadoopMapredExamplesJarName = "hadoop-mapreduce-examples-2.*.jar"
 
-yarn_pid_dir = format("{yarn_pid_dir_prefix}/{yarn_user}")
-mapred_pid_dir = format("{mapred_pid_dir_prefix}/{mapred_user}")
+yarn_pid_dir = status_params.yarn_pid_dir
+mapred_pid_dir = status_params.mapred_pid_dir
 
 mapred_log_dir = format("{mapred_log_dir_prefix}/{mapred_user}")
 yarn_log_dir = format("{yarn_log_dir_prefix}/{yarn_user}")

http://git-wip-us.apache.org/repos/asf/ambari/blob/4522c0d1/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/resourcemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/resourcemanager.py
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/resourcemanager.py
index aef6571..2be805c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/resourcemanager.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/resourcemanager.py
@@ -74,5 +74,10 @@ class Resourcemanager(Script):
             action='stop'
     )
 
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    check_process_status(status_params.resourcemanager_pid_file)
+
 if __name__ == "__main__":
   Resourcemanager().execute()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4522c0d1/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/status_params.py
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/status_params.py
new file mode 100644
index 0000000..e554513
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/YARN/package/scripts/status_params.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management import *
+
+config = Script.get_config()
+
+mapred_user = config['configurations']['global']['mapred_user']
+yarn_user = config['configurations']['global']['yarn_user']
+yarn_pid_dir_prefix = config['configurations']['global']['yarn_pid_dir_prefix']
+mapred_pid_dir_prefix = config['configurations']['global']['mapred_pid_dir_prefix']
+yarn_pid_dir = format("{yarn_pid_dir_prefix}/{yarn_user}")
+mapred_pid_dir = format("{mapred_pid_dir_prefix}/{mapred_user}")
+
+resourcemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-resourcemanager.pid")
+nodemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-nodemanager.pid")
+histroyserver_pid_file = format("{mapred_pid_dir}/mapred-{mapred_user}-historyserver.pid")
\ No newline at end of file


Mime
View raw message