resin3.10 resin4:多实例部署使用记录。

来源:互联网 发布:无线传感器网络 编辑:程序博客网 时间:2024/05/20 02:23

源于,公司一个项目的war包在tomcat部署没有问题。在resin3.10部署,找不到其他模块的一个类。
下载resin4.0.50多实例部署实例配置:
第一种方式:

第一个实例:

 <cluster id="napi1">    <!-- define the servers in the cluster -->    <server-multi id-prefix="napi1-" address-list="${napi1_servers}" port="6850" watchdog-port="6670"/>      <!-- the default host, matching any host name -->    <host id="" root-directory=".">      <!--         - webapps can be overridden/extended in the resin.xml        -->      <web-app id="/" root-directory="webapps/ROOT"/>      <web-app id="/loop-napi" root-directory="/letv/project/loop-napi"/>    </host>  </cluster>

第二个实例:

 <cluster id="napi2">    <!-- define the servers in the cluster -->    <server-multi id-prefix="napi2-" address-list="${napi2_servers}" port="6850" watchdog-port="6609"/>    <!-- the default host, matching any host name -->    <host id="" root-directory=".">      <!--         - webapps can be overridden/extended in the resin.xml        -->      <web-app id="/" root-directory="webapps/ROOT"/>      <web-app id="/loop-napi" root-directory="/letv/project/loop-napi"/>    </host>  </cluster>

3 resin.property文件配置

napi1-0.http : 8080

napi2-0.http : 8081

第二种方式:不需要修改app-default。只增加cluster

配置文件resin.xml修改如下改名为loop-napi3-4.xml:

<cluster id="loop-napi3">    <!-- define the servers in the cluster -->    <server id="loop-napi3" address="127.0.0.1" port="6803">       <http port="8083"/>    </server>   <host id="" root-directory=".">      <web-app id="/loop-napi"  root-directory="/Users/shenyb/Desktop/loop-napi"/>    </host>  </cluster>  <cluster id="loop-napi4">    <!-- define the servers in the cluster -->    <server id="loop-napi4" address="127.0.0.1" port="6804">       <http port="8084"/>    </server>    <host id="" root-directory=".">      <web-app id="/loop-napi"  root-directory="/Users/shenyb/Desktop/loop-napi"/>    </host>  </cluster>

启动脚本:
loop-napi3.start.sh:

#!/bin/shJAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/homeRESIN_HOME=/usr/local/share/resinRESIN_ROOT=/var/resinjava=$JAVA_HOME/bin/javaexport JAVA_HOMEexport RESIN_HOMEexport RESIN_ROOT$java -jar $RESIN_HOME/lib/resin.jar \      -root-directory $RESIN_ROOT \      -conf /etc/resin/loop-napi3-4.xml  \      -server loop-napi3 \       $*

loop-napi4.sh:

#!/bin/shJAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/homeRESIN_HOME=/usr/local/share/resinRESIN_ROOT=/var/resinjava=$JAVA_HOME/bin/javaexport JAVA_HOMEexport RESIN_HOMEexport RESIN_ROOT$java -jar $RESIN_HOME/lib/resin.jar \      -root-directory $RESIN_ROOT \      -conf /etc/resin/loop-napi3-4.xml  \      -server loop-napi4 \       $*

tomcat多实例部署文章比较多。就是在启动脚本catalina_base修改了就可以。每次启动catalina_home都会找catalina_base.

1 0
原创粉丝点击