users@glassfish.java.net

Re: Load Balancer Configuration?

From: <glassfish_at_javadesktop.org>
Date: Thu, 28 Feb 2008 23:14:20 PST

context root "/" maps to all applications. So for loadbalancer, it means that either of the cluster can service request coming for any application. In case you want behavior that cluster1 handle request for app1 and cluster2 handle request for app2, the modify your loadbalancer.xml as below:

<!DOCTYPE loadbalancer PUBLIC "-//Sun Microsystems Inc.//DTD Sun ONE Application Server 7.1//EN" "sun-loadbalancer_1_2.dtd">
<loadbalancer>
<cluster name="App-Server-01" policy="round-robin">
<instance name="App-01-Instance" enabled="true" disable-timeout-in-minutes="60" listeners="http://172.14.119.53:38081 https://172.14.119.53:38181" weight="100"/>
<web-module context-root="app1" enabled="true" disable-timeout-in-minutes="60" error-url="sun-http-lberror.html" />
<health-checker url="/" interval-in-seconds="10" timeout-in-seconds="30" />
</cluster>
<cluster name="App-Server-02" policy="round-robin">
<instance name="App-02-Instance" enabled="true" disable-timeout-in-minutes="60" listeners="http://172.14.119.53:38082 https://172.14.119.53:38182" weight="100"/>
<web-module context-root="app2" enabled="true" disable-timeout-in-minutes="60" error-url="sun-http-lberror.html" />
<health-checker url="/" interval-in-seconds="10" timeout-in-seconds="30" />
</cluster>
<property name="reload-poll-interval-in-seconds" value="60"/>
<property name="response-timeout-in-seconds" value="30"/>
<property name="https-routing" value="true"/>
<property name="require-monitor-data" value="false"/>
<property name="active-healthcheck-enabled" value="false"/>
<property name="number-healthcheck-retries" value="3"/>
<property name="rewrite-location" value="true"/>
</loadbalancer>

Please notice changes in context-root of web-modules specified.

Thanks,
Kshitiz
[Message sent by forum member 'kshitiz_saxena' (kshitiz_saxena)]

http://forums.java.net/jive/thread.jspa?messageID=261563