ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject ambari git commit: AMBARI-17743. Storm service check failed during Express Upgrade due to Nimbus going down after restart with CNF IClusterReporter. Part 2 (ncole)
Date Sat, 16 Jul 2016 19:09:22 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 0675cbd5f -> 19ca7c467


AMBARI-17743. Storm service check failed during Express Upgrade due to Nimbus going down after
restart with CNF IClusterReporter.  Part 2 (ncole)


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

Branch: refs/heads/branch-2.4
Commit: 19ca7c46721a312be0354dbb63687611c2e0cd8f
Parents: 0675cbd
Author: Nate Cole <ncole@hortonworks.com>
Authored: Sat Jul 16 15:09:07 2016 -0400
Committer: Nate Cole <ncole@hortonworks.com>
Committed: Sat Jul 16 15:09:07 2016 -0400

----------------------------------------------------------------------
 .../STORM/0.9.1/package/scripts/ui_server.py    |  6 +--
 .../stacks/2.1/STORM/test_storm_ui_server.py    | 43 ++++++++++++++++++++
 2 files changed, 46 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/19ca7c46/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/ui_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/ui_server.py
b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/ui_server.py
index 427b8ff..63d5731 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/ui_server.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/ui_server.py
@@ -93,10 +93,10 @@ class UiServerDefault(UiServer):
     # On old HDP 2.1 versions, this symlink may also exist and break EU to newer versions
     Link("/usr/lib/storm/lib/ambari-metrics-storm-sink.jar", action="delete")
 
-    if params.availableServices.has_key("STORM") and params.availableServices.get("STORM").startswith("0"):
-      sink_jar = params.metric_collector_legacy_sink_jar
-    else:
+    if check_stack_feature(StackFeature.STORM_METRICS_APACHE_CLASSES, params.version_for_stack_feature_checks):
       sink_jar = params.metric_collector_sink_jar
+    else:
+      sink_jar = params.metric_collector_legacy_sink_jar
 
     Execute(format("{sudo} ln -s {sink_jar} {storm_lib_dir}/ambari-metrics-storm-sink.jar"),
             not_if=format("ls {storm_lib_dir}/ambari-metrics-storm-sink.jar"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/19ca7c46/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
index 689eedc..d6497ed 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
@@ -73,6 +73,49 @@ class TestStormUiServer(TestStormBase):
     )
     self.assertNoMoreResources()
 
+  def test_start_with_apache_classes(self):
+    config_file = self.get_src_folder()+"/test/python/stacks/2.1/configs/default.json"
+    with open(config_file, "r") as f:
+      json_content = json.load(f)
+    version = '2.5.0.0-1234'
+    json_content['commandParams']['version'] = version
+
+
+
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ui_server.py",
+                       classname = "UiServer",
+                       command = "start",
+                       config_dict=json_content,
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+
+    self.assert_configure_default()
+
+    self.assertResourceCalled('Link', '/usr/lib/storm/lib//ambari-metrics-storm-sink.jar',
+                              action=['delete'],
+                              )
+
+    self.assertResourceCalled('Link', '/usr/lib/storm/lib/ambari-metrics-storm-sink.jar',
+                              action=['delete'],
+                              )
+
+    self.assertResourceCalled('Execute', 'ambari-sudo.sh ln -s /usr/lib/storm/lib/ambari-metrics-storm-sink-with-common-*.jar
'
+                                         '/usr/lib/storm/lib//ambari-metrics-storm-sink.jar',
+                              not_if=format("ls /usr/lib/storm/lib//ambari-metrics-storm-sink.jar"),
+                              only_if=format("ls /usr/lib/storm/lib/ambari-metrics-storm-sink-with-common-*.jar")
+                              )
+    self.assertResourceCalled('Execute', 'source /etc/storm/conf/storm-env.sh ; export PATH=$JAVA_HOME/bin:$PATH
; storm ui > /var/log/storm/ui.out 2>&1 &\n echo $! > /var/run/storm/ui.pid',
+        path = ['/usr/bin'],
+        user = 'storm',
+        not_if = "ambari-sudo.sh su storm -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/storm/ui.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/ui.pid`
>/dev/null 2>&1'",
+    )
+    self.assertResourceCalled('File', '/var/run/storm/ui.pid',
+        owner = 'storm',
+        group = 'hadoop',
+    )
+    self.assertNoMoreResources()
+
   @patch("os.path.exists")
   def test_stop_default(self, path_exists_mock):
     # Bool for the pid file


Mime
View raw message