Resin4启动默认有三个端口:
watch dog 用的6600 (配置文件里没有,可自行添加)
Http端口:8888 (对应app.http,可增加)
Server监听端口: 127.0.0.1:6800 (对应app_servers ,可增加)
说明:单个Resin不管同时配置几个应用,每次启动Resin之后,只会启动一个WatchDog监听,kill掉WatchDog后,所有的实例都会停止,WatchDog运行中,kill掉某个实例后,该实例会自动重启。
resin.properties中修改server端口
app_servers : 127.0.0.1:6800
bpp_servers : 127.0.0.1:6801
app.http : 8888
bpp.http : 9999
resin.xml修改WatchDog和增加cluer
<cluster id="app">
<!-- define the servers in the cluster -->
<server-multi id-prefix="app-" address-list="${app_servers}" port="6800" watchdog-port="6600"/>
<host-default>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps-1"
expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}"
path-suffix="${elastic_webapp?resin.id:''}"/>
</host-default>
<!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy>
<!-- 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"/>
</host>
<resin:if test="${resin_doc}">
<host id="${resin_doc_host}" root-directory="${resin_doc_host}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
</host>
</resin:if>
</cluster>
<cluster id="bpp">
<!-- define the servers in the cluster -->
<server-multi id-prefix="bpp-" address-list="${bpp_servers}" port="6801" watchdog-port="6601"/>
<host-default>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps"
expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}"
path-suffix="${elastic_webapp?resin.id:''}"/>
</host-default>
<!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy>
<!-- 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"/>
</host>
<resin:if test="${resin_doc}">
<host id="${resin_doc_host}" root-directory="${resin_doc_host}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
</host>
</resin:if>
</cluster>
经验证:只要WatchDog在运行中,修改server端口,不需要重启resin。