Application Server: Parameterized Web Server Cluster
From Resin 4.0 Wiki
- complete web-server cluster example
- resin.properties to parameterized values
- http port parameterized with EL ${http}
- cluster local IP parameterized with EL ${web_servers}
- server-multi expands into multiple servers by its parameters
- applications deploys with webapps/foo.war
- root application in webapps/ROOT
- sample shows a 3-server configuration but can use 1 to n servers.
startup
unix> resinctl start
Resin will fine the server configuration belonging to it by looking at the IP interfaces.
/etc/resin/resin.properties
http : 8080 web_servers : 192.168.1.10 192.168.1.11 192.168.1.12
/etc/resin/resin.xml
<resin xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin"> <resin:properties path="${__DIR__}/resin.properties" optional="true"/> <log-handler name="" level="all" path="stdout:"/> <home-cluster>web</home-cluster> <cluster id="web"> <resin:import path="classpath:META-INF/caucho/app-default.xml"/> <server-multi id-prefix="web-" address_list="${web_servers}" port="6800"> <http port="${http}"/> </server-multi> <host id=""> <web-app-deploy path="webapps"/> </host> </cluster> </resin>