You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2015/04/17 19:06:16 UTC

[1/2] ambari git commit: Revert "AMBARI-10561. Improve YARN service check (dlysnichenko)"

Repository: ambari
Updated Branches:
  refs/heads/trunk ac7507975 -> 4254fb4a1


Revert "AMBARI-10561. Improve YARN service check (dlysnichenko)"

This reverts commit ac7507975ad450d2e39eb9459129f04fc1e5dbc8.


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

Branch: refs/heads/trunk
Commit: 85aa856ba232ebd9836914b54585773c7a3d7d30
Parents: ac75079
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Fri Apr 17 20:05:24 2015 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Fri Apr 17 20:05:24 2015 +0300

----------------------------------------------------------------------
 .../2.1.0.2.0/package/scripts/service_check.py  | 30 ++++++++++++++------
 .../2.0.6/YARN/test_yarn_service_check.py       | 23 +++++++++++----
 2 files changed, 40 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/85aa856b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
index 547c687..2eef667 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
@@ -19,7 +19,6 @@ Ambari Agent
 
 """
 
-from resource_management.libraries.functions.version import compare_versions
 from resource_management import *
 import sys
 from ambari_commons import OSConst
@@ -79,19 +78,29 @@ class ServiceCheckDefault(ServiceCheck):
     import params
     env.set_params(params)
 
-    if params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.2') >= 0:
-      path_to_distributed_shell_jar = "/usr/hdp/current/hadoop-yarn-client/hadoop-yarn-applications-distributedshell.jar"
+    run_yarn_check_cmd = format("yarn --config {hadoop_conf_dir} node -list")
+
+    component_type = 'rm'
+    if params.hadoop_ssl_enabled:
+      component_address = params.rm_webui_https_address
     else:
-      path_to_distributed_shell_jar = "/usr/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell*.jar"
+      component_address = params.rm_webui_address
 
-    yarn_distrubuted_shell_check_cmd = format("yarn org.apache.hadoop.yarn.applications.distributedshell.Client "
-            "-shell_command ls -jar {path_to_distributed_shell_jar}")
+    validateStatusFileName = "validateYarnComponentStatus.py"
+    validateStatusFilePath = format("{tmp_dir}/{validateStatusFileName}")
+    python_executable = sys.executable
+    validateStatusCmd = format("{python_executable} {validateStatusFilePath} {component_type} -p {component_address} -s {hadoop_ssl_enabled}")
 
     if params.security_enabled:
       kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};")
-      smoke_cmd = format("{kinit_cmd} {yarn_distrubuted_shell_check_cmd}")
+      smoke_cmd = format("{kinit_cmd} {validateStatusCmd}")
     else:
-      smoke_cmd = yarn_distrubuted_shell_check_cmd
+      smoke_cmd = validateStatusCmd
+
+    File(validateStatusFilePath,
+         content=StaticFile(validateStatusFileName),
+         mode=0755
+    )
 
     Execute(smoke_cmd,
             tries=3,
@@ -101,6 +110,11 @@ class ServiceCheckDefault(ServiceCheck):
             logoutput=True
     )
 
+    Execute(run_yarn_check_cmd,
+            path=params.execute_path,
+            user=params.smokeuser
+    )
+
 
 if __name__ == "__main__":
   ServiceCheck().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/85aa856b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
index 1376fef..7cde2cc 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
@@ -36,14 +36,21 @@ class TestServiceCheck(RMFTestCase):
                           hdp_stack_version = self.STACK_VERSION,
                           target = RMFTestCase.TARGET_COMMON_SERVICES
     )
-    self.assertResourceCalled('Execute', 'yarn org.apache.hadoop.yarn.applications.distributedshell.Client '
-                                         '-shell_command ls -jar /usr/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell*.jar',
+    self.assertResourceCalled('File', '/tmp/validateYarnComponentStatus.py',
+                          content = StaticFile('validateYarnComponentStatus.py'),
+                          mode = 0755,
+    )
+    self.assertResourceCalled('Execute', '/usr/bin/python2.6 /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False',
                           logoutput = True,
                           path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                           tries = 3,
                           user = 'ambari-qa',
                           try_sleep = 5,
     )
+    self.assertResourceCalled('Execute', 'yarn --config /etc/hadoop/conf node -list',
+                              path = ["/bin:/usr/bin:/usr/lib/hadoop-yarn/bin"],
+                              user = 'ambari-qa',
+    )
     self.assertNoMoreResources()
 
   def test_service_check_secured(self):
@@ -54,13 +61,19 @@ class TestServiceCheck(RMFTestCase):
                           hdp_stack_version = self.STACK_VERSION,
                           target = RMFTestCase.TARGET_COMMON_SERVICES
     )
-    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab '
-                                         'ambari-qa@EXAMPLE.COM; yarn org.apache.hadoop.yarn.applications.distributedshell.Client '
-                                         '-shell_command ls -jar /usr/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell*.jar',
+    self.assertResourceCalled('File', '/tmp/validateYarnComponentStatus.py',
+                          content = StaticFile('validateYarnComponentStatus.py'),
+                          mode = 0755,
+    )
+    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM; /usr/bin/python2.6 /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False',
                           logoutput = True,
                           path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                           tries = 3,
                           user = 'ambari-qa',
                           try_sleep = 5,
     )
+    self.assertResourceCalled('Execute', 'yarn --config /etc/hadoop/conf node -list',
+                          path = ["/bin:/usr/bin:/usr/lib/hadoop-yarn/bin"],
+                          user = 'ambari-qa',
+    )
     self.assertNoMoreResources()


[2/2] ambari git commit: AMBARI-10561. Improve YARN service check (vbrodetskyi via dlysnichenko)

Posted by dm...@apache.org.
AMBARI-10561. Improve YARN service check (vbrodetskyi via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 4254fb4a1d5309b9a1b3133550f744419afc8533
Parents: 85aa856
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Fri Apr 17 20:03:48 2015 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Fri Apr 17 20:05:41 2015 +0300

----------------------------------------------------------------------
 .../2.1.0.2.0/package/scripts/service_check.py  | 30 ++++++--------------
 .../2.0.6/YARN/test_yarn_service_check.py       | 23 ++++-----------
 2 files changed, 13 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4254fb4a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
index 2eef667..547c687 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
@@ -19,6 +19,7 @@ Ambari Agent
 
 """
 
+from resource_management.libraries.functions.version import compare_versions
 from resource_management import *
 import sys
 from ambari_commons import OSConst
@@ -78,29 +79,19 @@ class ServiceCheckDefault(ServiceCheck):
     import params
     env.set_params(params)
 
-    run_yarn_check_cmd = format("yarn --config {hadoop_conf_dir} node -list")
-
-    component_type = 'rm'
-    if params.hadoop_ssl_enabled:
-      component_address = params.rm_webui_https_address
+    if params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.2') >= 0:
+      path_to_distributed_shell_jar = "/usr/hdp/current/hadoop-yarn-client/hadoop-yarn-applications-distributedshell.jar"
     else:
-      component_address = params.rm_webui_address
+      path_to_distributed_shell_jar = "/usr/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell*.jar"
 
-    validateStatusFileName = "validateYarnComponentStatus.py"
-    validateStatusFilePath = format("{tmp_dir}/{validateStatusFileName}")
-    python_executable = sys.executable
-    validateStatusCmd = format("{python_executable} {validateStatusFilePath} {component_type} -p {component_address} -s {hadoop_ssl_enabled}")
+    yarn_distrubuted_shell_check_cmd = format("yarn org.apache.hadoop.yarn.applications.distributedshell.Client "
+            "-shell_command ls -jar {path_to_distributed_shell_jar}")
 
     if params.security_enabled:
       kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};")
-      smoke_cmd = format("{kinit_cmd} {validateStatusCmd}")
+      smoke_cmd = format("{kinit_cmd} {yarn_distrubuted_shell_check_cmd}")
     else:
-      smoke_cmd = validateStatusCmd
-
-    File(validateStatusFilePath,
-         content=StaticFile(validateStatusFileName),
-         mode=0755
-    )
+      smoke_cmd = yarn_distrubuted_shell_check_cmd
 
     Execute(smoke_cmd,
             tries=3,
@@ -110,11 +101,6 @@ class ServiceCheckDefault(ServiceCheck):
             logoutput=True
     )
 
-    Execute(run_yarn_check_cmd,
-            path=params.execute_path,
-            user=params.smokeuser
-    )
-
 
 if __name__ == "__main__":
   ServiceCheck().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/4254fb4a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
index 7cde2cc..1376fef 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
@@ -36,21 +36,14 @@ class TestServiceCheck(RMFTestCase):
                           hdp_stack_version = self.STACK_VERSION,
                           target = RMFTestCase.TARGET_COMMON_SERVICES
     )
-    self.assertResourceCalled('File', '/tmp/validateYarnComponentStatus.py',
-                          content = StaticFile('validateYarnComponentStatus.py'),
-                          mode = 0755,
-    )
-    self.assertResourceCalled('Execute', '/usr/bin/python2.6 /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False',
+    self.assertResourceCalled('Execute', 'yarn org.apache.hadoop.yarn.applications.distributedshell.Client '
+                                         '-shell_command ls -jar /usr/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell*.jar',
                           logoutput = True,
                           path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                           tries = 3,
                           user = 'ambari-qa',
                           try_sleep = 5,
     )
-    self.assertResourceCalled('Execute', 'yarn --config /etc/hadoop/conf node -list',
-                              path = ["/bin:/usr/bin:/usr/lib/hadoop-yarn/bin"],
-                              user = 'ambari-qa',
-    )
     self.assertNoMoreResources()
 
   def test_service_check_secured(self):
@@ -61,19 +54,13 @@ class TestServiceCheck(RMFTestCase):
                           hdp_stack_version = self.STACK_VERSION,
                           target = RMFTestCase.TARGET_COMMON_SERVICES
     )
-    self.assertResourceCalled('File', '/tmp/validateYarnComponentStatus.py',
-                          content = StaticFile('validateYarnComponentStatus.py'),
-                          mode = 0755,
-    )
-    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa@EXAMPLE.COM; /usr/bin/python2.6 /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False',
+    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab '
+                                         'ambari-qa@EXAMPLE.COM; yarn org.apache.hadoop.yarn.applications.distributedshell.Client '
+                                         '-shell_command ls -jar /usr/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell*.jar',
                           logoutput = True,
                           path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                           tries = 3,
                           user = 'ambari-qa',
                           try_sleep = 5,
     )
-    self.assertResourceCalled('Execute', 'yarn --config /etc/hadoop/conf node -list',
-                          path = ["/bin:/usr/bin:/usr/lib/hadoop-yarn/bin"],
-                          user = 'ambari-qa',
-    )
     self.assertNoMoreResources()