Browse Source

AMBARI-7943. Slider installation should also install storm-slider client

Sumit Mohanty 10 years ago
parent
commit
1e7e5e99e4

+ 6 - 0
ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml

@@ -91,6 +91,9 @@
             <package>
               <name>slider_2_2_*</name>
             </package>
+            <package>
+              <name>storm_2_2_*-slider-client</name>
+            </package>
           </packages>
         </osSpecific>
         <osSpecific>
@@ -99,6 +102,9 @@
             <package>
               <name>slider-2-2-.*</name>
             </package>
+            <package>
+              <name>storm-2-2-.*-slider-client</name>
+            </package>
           </packages>
         </osSpecific>
       </osSpecifics>

+ 2 - 0
ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py

@@ -43,3 +43,5 @@ slider_env_sh_template = config['configurations']['slider-env']['content']
 java64_home = config['hostLevelParams']['java_home']
 log4j_props = config['configurations']['slider-log4j']['content']
 slider_cmd = format("{slider_bin_dir}/slider")
+storm_slider_conf_dir= '/usr/hdp/current/storm-slider-client/conf'
+slider_home_dir= '/usr/hdp/current/slider-client'

+ 9 - 0
ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py

@@ -40,6 +40,15 @@ def slider():
        content=InlineTemplate(params.slider_env_sh_template)
   )
 
+  Directory(params.storm_slider_conf_dir,
+            recursive=True
+  )
+
+  File(format("{storm_slider_conf_dir}/storm-slider-env.sh"),
+       mode=0755,
+       content=Template('storm-slider-env.sh.j2')
+  )
+
   if (params.log4j_props != None):
     File(format("{params.slider_conf_dir}/log4j.properties"),
          mode=0644,

+ 38 - 0
ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/storm-slider-env.sh.j2

@@ -0,0 +1,38 @@
+{#
+# 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.
+#}
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#/*
+# * 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.
+# */
+export JAVA_HOME={{java64_home}}
+export SLIDER_HOME={{slider_home_dir}}

+ 10 - 0
ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py

@@ -45,6 +45,16 @@ class TestSliderClient(RMFTestCase):
                               mode = 0755,
                               )
 
+    self.assertResourceCalled('Directory',
+                              '/usr/hdp/current/storm-slider-client/conf',
+                              recursive=True
+    )
+
+    self.assertResourceCalled('File', '/usr/hdp/current/storm-slider-client/conf/storm-slider-env.sh',
+                              content=Template('storm-slider-env.sh.j2'),
+                              mode = 0755,
+                              )
+
     self.assertResourceCalled('File',
                               '/etc/slider/conf/log4j.properties',
                               mode=0644,