add catalog service start and stop scripts
authorsunqi310 <sun.qi310@zte.com.cn>
Mon, 29 Aug 2016 08:47:41 +0000 (16:47 +0800)
committersunqi310 <sun.qi310@zte.com.cn>
Mon, 29 Aug 2016 08:47:41 +0000 (16:47 +0800)
Change-Id: I10e37beac3fae52f5b233a56fadf27ac3bf2f01e
Signed-off-by: sunqi310 <sun.qi310@zte.com.cn>
catalog-core/distribution/catalog-all/pom.xml
catalog-core/distribution/catalog-all/src/main/assembly/shutdown.bat [new file with mode: 0644]
catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh [new file with mode: 0644]
catalog-core/distribution/catalog-all/src/main/assembly/startup.bat [new file with mode: 0644]
catalog-core/distribution/catalog-all/src/main/assembly/startup.sh [new file with mode: 0644]
catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog.yml
catalog-core/httpserver/src/main/assembly/tomcat/conf/server.xml [new file with mode: 0644]

index 3762372..88c45c4 100644 (file)
     </properties>
     <build>
         <plugins>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>target/assembly/</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/assembly/</directory>
+                                    <filtering>false</filtering>
+                                    <includes>
+                                        <include>**/*</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <overwrite>true</overwrite>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.bat b/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.bat
new file mode 100644 (file)
index 0000000..9697dba
--- /dev/null
@@ -0,0 +1,27 @@
+@REM\r
+@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)\r
+@REM\r
+@REM Licensed under the Apache License, Version 2.0 (the "License");\r
+@REM you may not use this file except in compliance with the License.\r
+@REM You may obtain a copy of the License at\r
+@REM\r
+@REM         http://www.apache.org/licenses/LICENSE-2.0\r
+@REM\r
+@REM Unless required by applicable law or agreed to in writing, software\r
+@REM distributed under the License is distributed on an "AS IS" BASIS,\r
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+@REM See the License for the specific language governing permissions and\r
+@REM limitations under the License.\r
+@REM\r
+@echo off\r
+title catalog\r
+\r
+set RUNHOME=%~dp0\r
+echo ##RUNHOME %RUNHOME%\r
+\r
+\r
+echo ### Starting catalog\r
+start /D %RUNHOME%catalog stop.bat\r
+\r
+echo ### Starting tomcat\r
+start /D %RUNHOME%tomcat bin\shutdown.bat \r
diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh b/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh
new file mode 100644 (file)
index 0000000..ae1999a
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+#
+# Licensed 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.
+#
+DIRNAME=`dirname $0`
+RUNHOME=`cd $DIRNAME/; pwd`
+echo @RUNHOME@ $RUNHOME
+
+echo "### Starting catalog";
+cd catalog
+./stop.sh &
+cd $RUNHOME
+
+
+echo "\n\n### Starting catalog-http server"
+cd ./tomcat
+./bin/shutdown.sh &
+echo "### Starting catalog end...";
diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/startup.bat b/catalog-core/distribution/catalog-all/src/main/assembly/startup.bat
new file mode 100644 (file)
index 0000000..6dd72c8
--- /dev/null
@@ -0,0 +1,28 @@
+@REM\r
+@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)\r
+@REM\r
+@REM Licensed under the Apache License, Version 2.0 (the "License");\r
+@REM you may not use this file except in compliance with the License.\r
+@REM You may obtain a copy of the License at\r
+@REM\r
+@REM         http://www.apache.org/licenses/LICENSE-2.0\r
+@REM\r
+@REM Unless required by applicable law or agreed to in writing, software\r
+@REM distributed under the License is distributed on an "AS IS" BASIS,\r
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+@REM See the License for the specific language governing permissions and\r
+@REM limitations under the License.\r
+@REM\r
+@echo off\r
+title catalog\r
+\r
+set RUNHOME=%~dp0\r
+echo ##RUNHOME %RUNHOME%\r
+\r
+\r
+echo ### Starting catalog\r
+start /D %RUNHOME%catalog run.bat\r
+\r
+echo ### Starting tomcat\r
+start /D %RUNHOME%tomcat bin\startup.bat \r
+\r
diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh b/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh
new file mode 100644 (file)
index 0000000..212ebde
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+#
+# Licensed 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.
+#
+DIRNAME=`dirname $0`
+RUNHOME=`cd $DIRNAME/; pwd`
+echo @RUNHOME@ $RUNHOME
+
+echo "### Starting catalog";
+cd catalog
+./run.sh &
+cd $RUNHOME
+
+
+echo "\n\n### Starting catalog-http server"
+cd ./tomcat
+./bin/startup.sh &
+echo "### Starting catalog end...";
+
index 14deab7..1cd7d3a 100644 (file)
@@ -42,7 +42,7 @@ database:
   password: catalog\r
 \r
   # the JDBC URL\r
-  url: jdbc:mysql://10.74.148.157:3306/catalog\r
+  url: jdbc:mysql://127.0.0.1:3306/catalog\r
 #LDAP\r
 ldapServerIp: 127.0.0.1\r
 ldapServerPort: 20096\r
@@ -63,7 +63,7 @@ server:
   adminContextPath: /admin\r
   connector:\r
     type: http\r
-    port: 8212\r
+    port: 8200\r
 \r
 # Logging settings.\r
 logging:\r
diff --git a/catalog-core/httpserver/src/main/assembly/tomcat/conf/server.xml b/catalog-core/httpserver/src/main/assembly/tomcat/conf/server.xml
new file mode 100644 (file)
index 0000000..7d12c6c
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version='1.0' encoding='utf-8'?>\r
+<!--\r
+  Licensed to the Apache Software Foundation (ASF) under one or more\r
+  contributor license agreements.  See the NOTICE file distributed with\r
+  this work for additional information regarding copyright ownership.\r
+  The ASF licenses this file to You under the Apache License, Version 2.0\r
+  (the "License"); you may not use this file except in compliance with\r
+  the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+<!-- Note:  A "Server" is not itself a "Container", so you may not\r
+     define subcomponents such as "Valves" at this level.\r
+     Documentation at /docs/config/server.html\r
+ -->\r
+<Server port="8005" shutdown="SHUTDOWN">\r
+  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />\r
+  <!-- Security listener. Documentation at /docs/config/listeners.html\r
+  <Listener className="org.apache.catalina.security.SecurityListener" />\r
+  -->\r
+  <!--APR library loader. Documentation at /docs/apr.html -->\r
+  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />\r
+  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->\r
+  <Listener className="org.apache.catalina.core.JasperListener" />\r
+  <!-- Prevent memory leaks due to use of particular java/javax APIs-->\r
+  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />\r
+  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />\r
+  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />\r
+\r
+  <!-- Global JNDI resources\r
+       Documentation at /docs/jndi-resources-howto.html\r
+  -->\r
+  <GlobalNamingResources>\r
+    <!-- Editable user database that can also be used by\r
+         UserDatabaseRealm to authenticate users\r
+    -->\r
+    <Resource name="UserDatabase" auth="Container"\r
+              type="org.apache.catalina.UserDatabase"\r
+              description="User database that can be updated and saved"\r
+              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"\r
+              pathname="conf/tomcat-users.xml" />\r
+  </GlobalNamingResources>\r
+\r
+  <!-- A "Service" is a collection of one or more "Connectors" that share\r
+       a single "Container" Note:  A "Service" is not itself a "Container",\r
+       so you may not define subcomponents such as "Valves" at this level.\r
+       Documentation at /docs/config/service.html\r
+   -->\r
+  <Service name="Catalina">\r
+\r
+    <!--The connectors can use a shared executor, you can define one or more named thread pools-->\r
+    <!--\r
+    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"\r
+        maxThreads="150" minSpareThreads="4"/>\r
+    -->\r
+\r
+\r
+    <!-- A "Connector" represents an endpoint by which requests are received\r
+         and responses are returned. Documentation at :\r
+         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)\r
+         Java AJP  Connector: /docs/config/ajp.html\r
+         APR (HTTP/AJP) Connector: /docs/apr.html\r
+         Define a non-SSL HTTP/1.1 Connector on port 8080\r
+    -->\r
+    <Connector port="8201" protocol="HTTP/1.1"\r
+               connectionTimeout="20000"\r
+               redirectPort="8443" />\r
+    <!-- A "Connector" using the shared thread pool-->\r
+    <!--\r
+    <Connector executor="tomcatThreadPool"\r
+               port="8080" protocol="HTTP/1.1"\r
+               connectionTimeout="20000"\r
+               redirectPort="8443" />\r
+    -->\r
+    <!-- Define a SSL HTTP/1.1 Connector on port 8443\r
+         This connector uses the BIO implementation that requires the JSSE\r
+         style configuration. When using the APR/native implementation, the\r
+         OpenSSL style configuration is required as described in the APR/native\r
+         documentation -->\r
+    <!--\r
+    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"\r
+               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"\r
+               clientAuth="false" sslProtocol="TLS" />\r
+    -->\r
+\r
+    <!-- Define an AJP 1.3 Connector on port 8009 -->\r
+    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />\r
+\r
+\r
+    <!-- An Engine represents the entry point (within Catalina) that processes\r
+         every request.  The Engine implementation for Tomcat stand alone\r
+         analyzes the HTTP headers included with the request, and passes them\r
+         on to the appropriate Host (virtual host).\r
+         Documentation at /docs/config/engine.html -->\r
+\r
+    <!-- You should set jvmRoute to support load-balancing via AJP ie :\r
+    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">\r
+    -->\r
+    <Engine name="Catalina" defaultHost="localhost">\r
+\r
+      <!--For clustering, please take a look at documentation at:\r
+          /docs/cluster-howto.html  (simple how to)\r
+          /docs/config/cluster.html (reference documentation) -->\r
+      <!--\r
+      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>\r
+      -->\r
+\r
+      <!-- Use the LockOutRealm to prevent attempts to guess user passwords\r
+           via a brute-force attack -->\r
+      <Realm className="org.apache.catalina.realm.LockOutRealm">\r
+        <!-- This Realm uses the UserDatabase configured in the global JNDI\r
+             resources under the key "UserDatabase".  Any edits\r
+             that are performed against this UserDatabase are immediately\r
+             available for use by the Realm.  -->\r
+        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"\r
+               resourceName="UserDatabase"/>\r
+      </Realm>\r
+\r
+      <Host name="localhost"  appBase="webapps"\r
+            unpackWARs="true" autoDeploy="true">\r
+\r
+        <!-- SingleSignOn valve, share authentication between web applications\r
+             Documentation at: /docs/config/valve.html -->\r
+        <!--\r
+        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />\r
+        -->\r
+\r
+        <!-- Access log processes all example.\r
+             Documentation at: /docs/config/valve.html\r
+             Note: The pattern used is equivalent to using pattern="common" -->\r
+        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"\r
+               prefix="localhost_access_log." suffix=".txt"\r
+               pattern="%h %l %u %t &quot;%r&quot; %s %b" />\r
+\r
+      </Host>\r
+    </Engine>\r
+  </Service>\r
+</Server>\r