(non multicast environment - manual proxy registration required)
1. Start all servers.
2. Register servers with proxy, by invoking addProxy httpd-server-address, 6666 on each backend server.
3. Open up a session via http (e.g. jmx-console or node-info) from a client
4. Determine which backend server is being used (e.g. via inspecting cookie on client with firebug)
5. kill -9 jboss process on active node.
6. Refresh on client. 503 error.
7. From a different client / or clear session & cookies, visit URL
Configuration
------------------
server.xml:
<Listener className="org.jboss.mocluster.catalina.ModClusterListener"
advertise="false"
stopContextTimeout="5"
socketTimeout="5000"
maxAttempts="10"
stickySessionsForce="false"
balancer="loadbalancer"
workerTimeout="30"
nodeTimeout="10"
/>
mod_cluster-jboss-beans.xml:
<bean name="ModClusterListener" class="org.jboss.mocluster.catalina.CatalinaEventHandlerAdapter" mode="On Demand">
<constructor>
<parameter><inject bean="HAModClusterService"/></parameter>
<parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
</constructor>
</bean>
all other config is default.
httpd config (excluding LoadModule directives. mod_advertise is not loaded).
CreateBalancers 0
ManagerBalancerName loadbalancer
- Have tried with this enabled: ProxyTimeout 10
<Location /mod_cluster_manger>
SetHandler mod_cluster-manager
</Location>
Listen 6666
<VirtualHost *:6666>
KeepAliveTimeout 60
MaxKeepAliveRequests 0
ManagerBalancerName loadbalancer
</VirtualHost>
Dump on mod_cluster-manager before node is killed (Timeout: 5 minutes?? - this is true even when nodeTimeout is set on the Listener to send to http and when configured on httpd via ProxyTimeout):
balancer: [1] Name: loadbalancer Sticky: 1 [JSESSIONID]/[jsessionid] remove: 1 force: 0 Timeout: 30000000 Maxtry: 10
node: [1:1],Balancer: loadbalancer,JVMRoute: dev-test-01,Domain: [],Host: 192.168.73.21,Port: 8009,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 1,ttl: 60,timeout: 10
node: [2:2],Balancer: loadbalancer,JVMRoute: dev-test-02,Domain: [],Host: 192.168.75.22,Port: 8009,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 1,ttl: 60,timeout: 10
host: 1 [localhost] vhost: 1 node: 1
host: 2 [localhost] vhost: 1 node: 2
context: 1 [/jmx-console] vhost: 1 node: 1 status: 1
context: 2 [/node-info] vhost: 1 node: 1 status: 1
context: 3 [/jmx-console] vhost: 1 node: 2 status: 1
context: 4 [/node-info] vhost: 1 node: 2 status: 1
backend1 # kill -9 <pid of JBoss>
The mod_cluster-manager handler shows:
Balancer: loadbalancer,Domain: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 1,Ttl: 60000000,Status: NOTOK,Elected: 3,Read: 846,Transferred: 0,Connected: 0,Load: 100
INFO output shows:
Node: [1],Name: dev-test-01,Balancer: loadbalancer,Domain: ,Host: 192.168.73.21,Port: 8009,Type: ajp,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 1,Ttl: 60000000,Elected: 3,Read: 846,Transfered: 0,Connected: 0,Load: 100
Node: [2],Name: dev-test-02,Balancer: loadbalancer,Domain: ,Host: 192.168.75.22,Port: 8009,Type: ajp,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 1,Ttl: 60000000,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: -1
Vhost: [1:1:1], Alias: localhost
Vhost: [2:1:2], Alias: localhost
Context: [1:1:1], Context: /jmx-console, Status: ENABLED
Context: [1:1:2], Context: /node-info, Status: ENABLED
Context: [2:1:3], Context: /jmx-console, Status: ENABLED
Context: [2:1:4], Context: /node-info, Status: ENABLED