You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by el...@apache.org on 2015/04/27 06:15:53 UTC

[1/2] incubator-slider git commit: SLIDER-809 Fix some discrepancies from the first commit.

Repository: incubator-slider
Updated Branches:
  refs/heads/feature/SLIDER-809-tomcat-app-package 975c2f644 -> 940c9a8ad


SLIDER-809 Fix some discrepancies from the first commit.

* Fix http_port allocated port definition
* Use proper file name/paths for tomcat tarball
* Define the server-xml configuration key
* Remove unnecessary configuration calls (stop and status)


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/6d761023
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/6d761023
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/6d761023

Branch: refs/heads/feature/SLIDER-809-tomcat-app-package
Commit: 6d7610238e08868c5cd369091d58e017d45cbb6b
Parents: 975c2f6
Author: Josh Elser <el...@apache.org>
Authored: Mon Apr 27 00:03:41 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon Apr 27 00:03:41 2015 -0400

----------------------------------------------------------------------
 app-packages/tomcat/metainfo.xml              | 14 +++++++++++---
 app-packages/tomcat/package/scripts/params.py |  1 +
 app-packages/tomcat/package/scripts/tomcat.py | 11 +++++++----
 3 files changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6d761023/app-packages/tomcat/metainfo.xml
----------------------------------------------------------------------
diff --git a/app-packages/tomcat/metainfo.xml b/app-packages/tomcat/metainfo.xml
index 6710ef1..3138573 100644
--- a/app-packages/tomcat/metainfo.xml
+++ b/app-packages/tomcat/metainfo.xml
@@ -10,8 +10,8 @@
         <name>Servers</name>
         <exports>
           <export>
-            <name>host_port</name>
-            <value>${TOMCAT_HOST}:${site.global.listen_port}</value>
+            <name>tomcat.http_port</name>
+            <value>${TOMCAT_HOST}:${site.server-xml.http.port}</value>
           </export>
         </exports>
       </exportGroup>
@@ -33,7 +33,7 @@
         <packages>
           <package>
             <type>tarball</type>
-            <name>files/apache-tomcat.tar.gz</name>
+            <name>files/tomcat-8.0.20.tar.gz</name>
           </package>
         </packages>
       </osSpecific>
@@ -50,5 +50,13 @@
          </exports>
       </exportGroup>
     </exportGroups>
+
+    <configFiles>
+      <configFile>
+        <type>env</type>
+        <fileName>server.xml</fileName>
+        <dictionaryName>server-xml</dictionaryName>
+      </configFile>
+    </configFiles>
   </application>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6d761023/app-packages/tomcat/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/app-packages/tomcat/package/scripts/params.py b/app-packages/tomcat/package/scripts/params.py
index a1943d5..fe058b7 100644
--- a/app-packages/tomcat/package/scripts/params.py
+++ b/app-packages/tomcat/package/scripts/params.py
@@ -24,6 +24,7 @@ from resource_management import *
 config = Script.get_config()
 
 app_root = config['configurations']['global']['app_root']
+conf_dir = format("{app_root}/apache-tomcat-8.0.20/conf")
 java64_home = config['hostLevelParams']['java_home']
 pid_file = config['configurations']['global']['pid_file']
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6d761023/app-packages/tomcat/package/scripts/tomcat.py
----------------------------------------------------------------------
diff --git a/app-packages/tomcat/package/scripts/tomcat.py b/app-packages/tomcat/package/scripts/tomcat.py
index 35599a9..3771eae 100644
--- a/app-packages/tomcat/package/scripts/tomcat.py
+++ b/app-packages/tomcat/package/scripts/tomcat.py
@@ -33,9 +33,10 @@ class Tomcat(Script):
 
   def start(self, env):
     import params
+    # implicit that the params/env are properly configured
     self.configure(env)
     tomcat_pid = format('{app_root}/catalina.pid')
-    process_cmd = format('env JAVA_HOME={java64_home} CATALINA_PID=' + tomcat_pid + ' {app_root}/apache-tomcat-*/bin/catalina.sh start')
+    process_cmd = format('env JAVA_HOME={java64_home} CATALINA_PID=' + tomcat_pid + ' {app_root}/apache-tomcat-8.0.20/bin/catalina.sh start')
 
     Execute(process_cmd,
         logoutput=False,
@@ -46,9 +47,10 @@ class Tomcat(Script):
 
   def stop(self, env):
     import params
-    self.configure(env)
+    # Don't need to re-call configure()
+    env.set_params(params)
     tomcat_pid = format('{app_root}/catalina.pid')
-    process_cmd = format('env JAVA_HOME={java64_home} CATALINA_PID=' + tomcat_pid + ' {app_root}/apache-tomcat-*/bin/catalina.sh stop')
+    process_cmd = format('env JAVA_HOME={java64_home} CATALINA_PID=' + tomcat_pid + ' {app_root}/apache-tomcat-8.0.20/bin/catalina.sh stop')
 
     Execute(process_cmd,
         logoutput=True,
@@ -59,7 +61,8 @@ class Tomcat(Script):
 
   def status(self, env):
     import params
-    self.configure(env)
+    # Don't need to re-call configure()
+    env.set_params(params)
     tomcat_pid = format('{app_root}/catalina.pid')
     check_process_status(tomcat_pid)
 


[2/2] incubator-slider git commit: SLIDER-809 Write up a brief README on what _should_ work for tomcat.

Posted by el...@apache.org.
SLIDER-809 Write up a brief README on what _should_ work for tomcat.


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/940c9a8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/940c9a8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/940c9a8a

Branch: refs/heads/feature/SLIDER-809-tomcat-app-package
Commit: 940c9a8ad9fc212611a9324c38db4d1d9bc5888f
Parents: 6d76102
Author: Josh Elser <el...@apache.org>
Authored: Mon Apr 27 00:15:18 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon Apr 27 00:15:18 2015 -0400

----------------------------------------------------------------------
 app-packages/tomcat/README.md | 53 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/940c9a8a/app-packages/tomcat/README.md
----------------------------------------------------------------------
diff --git a/app-packages/tomcat/README.md b/app-packages/tomcat/README.md
new file mode 100644
index 0000000..0121bce
--- /dev/null
+++ b/app-packages/tomcat/README.md
@@ -0,0 +1,53 @@
+<!---
+   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.
+-->
+
+# Apache Tomcat
+
+Basic instructions on using the Apache Tomcat app-package.
+
+## Installation
+
+The Tomcat application package is distributed as a zip archive.
+Use the `slider install` command to install it into HDFS for use.
+You must also provide an identifying name (such as "tomcat").
+
+`slider install-package --name tomcat --package path/to/slider-tomcat-app-package-0.72.0-incubating-SNAPSHOT.zip`
+
+## Configuration
+
+Copy appConfig-default.json and resources-default.json. By default, these files
+will create one instance of Tomcat using a dynamic port provided by
+Slider.
+
+In the copied appConfig.json, make sure you set `application.def` and
+`java_home`. Feel free to adjust the memory usage as well.
+
+
+## Create a Slider cluster
+
+Use the appConfig.json and resources.json file to create a Slider cluster now.
+The name of the cluster is user defined and must be unique: this example uses "tomcat1"
+
+`slider create tomcat1 --template path/to/appConfig.json --resources path/to/resources.json`
+
+## Verify
+
+Check the Slider Application Master page on the Hadoop YARN status page. You should see
+the application running and without failures.
+
+Until the QuickLinks/exports is resolved for this app package, the port must be determined manually
+using a tool such as `netstat` and the pid of the Tomcat process. Sorry.