标签:resin
Resin 运行起来后,一般有这么几个端口首先Resin中每个应用会占用一个HTTP端口以及一个Server监控端口,假设有两个应用,我们分配的端口分别是:
app1:8010,6801
app2:8020,6802
下面是详细的配置:
<cluster id="app1">
<server-default>
<jvm-arg>-Xms512m</jvm-arg>
<jvm-arg>-Xmx512m</jvm-arg>
<jvm-arg>-Xmn128m</jvm-arg>
<jvm-arg>-XX:PermSize=64m</jvm-arg>
<jvm-arg>-XX:MaxPermSize=128m</jvm-arg>
<thread-max>512</thread-max>
<socket-timeout>30s</socket-timeout>
<keepalive-max>512</keepalive-max>
<keepalive-timeout>60s</keepalive-timeout>
</server-default>
<!-- define the servers in the cluster -->
<server-multi id-prefix="app1-" address-list="127.0.0.1" port="6801">
<http address="192.168.30.10" port="8010"/>
</server-multi>
<!-- the default host, matching any host name -->
<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" character-encoding=‘UTF-8‘ document-directory="/data/project/app1/ROOT" archive-path="/data/project/app1/ROOT.war">
<form-parameter-max>100</form-parameter-max>
<stderr-log path=‘/data/logs/app1/stderr.log‘ timestamp=‘[%Y-%m-%d %H:%M:%S] ‘ rollover-period=‘1D‘/>
<stdout-log path=‘/data/logs/app1/stdout.log‘ timestamp=‘[%Y-%m-%d %H:%M:%S] ‘ rollover-period=‘1D‘/>
</web-app>
</host>
</cluster>
<cluster id="app2">
<server-default>
<jvm-arg>-Xms512m</jvm-arg>
<jvm-arg>-Xmx512m</jvm-arg>
<jvm-arg>-Xmn128m</jvm-arg>
<jvm-arg>-XX:PermSize=64m</jvm-arg>
<jvm-arg>-XX:MaxPermSize=128m</jvm-arg>
<thread-max>512</thread-max>
<socket-timeout>30s</socket-timeout>
<keepalive-max>512</keepalive-max>
<keepalive-timeout>60s</keepalive-timeout>
</server-default>
<server-multi id-prefix="app2-" address-list="127.0.0.1" port="6802">
<http address="192.168.30.10" port="8020"/>
</server-multi>
<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" character-encoding=‘UTF-8‘ document-directory="/data/project/app2/ROOT" archive-path="/data/project/app2/ROOT.war">
<form-parameter-max>100</form-parameter-max>
<stderr-log path=‘/data/logs/app2/stderr.log‘ timestamp=‘[%Y-%m-%d %H:%M:%S] ‘ rollover-period=‘1D‘/>
<stdout-log path=‘/data/logs/app2/stdout.log‘ timestamp=‘[%Y-%m-%d %H:%M:%S] ‘ rollover-period=‘1D‘/>
</web-app>
</host>
</cluster>
上面的配置中,我们为每个应用分配一个唯一的 server id,分别是 app1 和 app2
要启动这两个应用,命令文件在resin的bin目录中
resin.sh start -server app1-0
resin.sh start -server app2-0
停止命令:
resin.sh stop -server app1-0
resin.sh stop -server app2-0
标签:resin
原文地址:http://blog.51cto.com/qiangsh/2113423