I have now configured workers.properties for both JBOSS HTTPD server and Standard Appache HTTPD Server. I h
I have added following line to the file.
worker.balancer.sticky-session=false
"sticky-session" attribute is also sugested for proxy-configuration in
http://docs.jboss.org/mod_cluster/1.2.0/html/java.properties.html
to make the sessiion replication , it was required to use "tcp" instead of "udp" in jgroup subsystem. therefore i have tweak the configuration as follows;
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>
<protocol type="TCPPING">
<property name="timeout">
10000
</property>
<property name="initial_hosts">
127.0.0.1[8230],127.0.0.1[8330]
</property>
<property name="port_range">
1
</property>
<property name="num_initial_members">
2
</property>
</protocol>
</stack>
</subsystem>
this time I thought "fail-over" became certain thing for both servers(it was random on JBOSS HTTPD server). However it only works for first time. (ex: boot two servers for the clustre, stop one who is serving request, then other server in the cluster will be able to serve the requests).
after the stopped server is started again, it is attached to cluster but the session was not sucessfully transfered. (I suspected "session replication" is not taking place in jboss AS side, or load balancer is not handling "fail-over" and "load-balancing" consistently)
if we stop the server who is currently serving request, and thereafter for all web requests you will end up with "service temporary unavailable" error.
I think this proves additional configuration / fixes required to mod_cluster_proxy module or its not visible to users.
Digging further, to see consistency of "session replication" , "fail-over" and "load-balancing", I have done further observations as follows;
lets say, I boot up the cluster c where c={server-two, server-three}
then i had web request http://localhost/cluster-demo-master
which is sucessfully served by server-two, as shown in the console.
then i shur down server-two , now new cluster c', is c'={server-three}.
then i had web request http://localhost/cluster-demo-master
which is sucessfully served by server-three, as shown in the console.
following is the logging extract from server-three. which proves infinispan and jgroup working properly, replicating the session, which obtained from web cache container and cache repl.
then i had web request http://localhost/cluster-demo-master
which is still sucessfully served by server-three, as shown in the console.
09:11:34,378 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (MSC service thread 1-3) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:11:34,378 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (MSC service thread 1-2) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:11:34,425 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (pool-14-thread-1) ISPN000078: Starting JGroups Channel
09:11:34,440 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (pool-14-thread-1) ISPN000094: Received new cluster view: [master:server-three/web|0] [master:server-three/web]
09:11:34,440 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (pool-14-thread-1) ISPN000079: Cache local address is master:server-three/web, physical addresses are [127.0.0.1:7850]
09:11:34,440 INFO [org.infinispan.factories.GlobalComponentRegistry] (pool-14-thread-1) ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL
09:11:34,440 INFO [org.infinispan.config.ConfigurationValidatingVisitor] (pool-14-thread-1) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:11:34,550 INFO [org.infinispan.jmx.CacheJmxRegistration] (pool-14-thread-1) ISPN000031: MBeans were successfully registered to the platform mbean server.
09:11:34,565 INFO [org.jboss.as.clustering.infinispan] (pool-14-thread-1) JBAS010281: Started repl cache from web container
09:11:34,581 INFO [org.jboss.as.clustering.impl.CoreGroupCommunicationService.web] (MSC service thread 1-3) JBAS010206: Number of cluster members: 1
09:11:34,612 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (MSC service thread 1-2) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:11:34,612 INFO [org.infinispan.config.ConfigurationValidatingVisitor] (MSC service thread 1-2) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:11:34,628 INFO [org.infinispan.jmx.CacheJmxRegistration] (MSC service thread 1-2) ISPN000031: MBeans were successfully registered to the platform mbean server.
09:11:34,628 INFO [org.jboss.as.clustering.infinispan] (MSC service thread 1-2) JBAS010281: Started //default-host//cluster-demo-master cache from web container
09:11:34,644 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (MSC service thread 1-2) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:11:34,644 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (MSC service thread 1-2) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:11:34,737 INFO [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /cluster-demo-master
09:11:36,628 INFO [org.jboss.modcluster.ModClusterService] (MSC service thread 1-4) Initializing mod_cluster 1.2.0.Final
09:11:36,659 INFO [org.jboss.modcluster.advertise.impl.AdvertiseListenerImpl] (MSC service thread 1-4) Listening to proxy advertisements on 224.0.1.105:23364
09:11:36,690 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "cluster-demo-master.war"
09:11:36,737 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 7890ms - Started 193 of 324 services (130 services are passive or on-demand)
I start the server-two again, now my new cluster c'', where c''={server-three,server-two}.
server-two log extract is as follows (similar to server-three above). session replication is happening
09:34:26,824 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (pool-11-thread-1) ISPN000078: Starting JGroups Channel
09:34:26,839 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (pool-11-thread-1) ISPN000094: Received new cluster view: [master:server-two/web|0] [master:server-two/web]
09:34:26,839 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (pool-11-thread-1) ISPN000079: Cache local address is master:server-two/web, physical addresses are [127.0.0.1:7750]
09:34:26,839 INFO [org.infinispan.factories.GlobalComponentRegistry] (pool-11-thread-1) ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL
09:34:26,855 INFO [org.infinispan.config.ConfigurationValidatingVisitor] (pool-11-thread-1) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:34:26,964 INFO [org.infinispan.jmx.CacheJmxRegistration] (pool-11-thread-1) ISPN000031: MBeans were successfully registered to the platform mbean server.
09:34:26,980 INFO [org.jboss.as.clustering.infinispan] (pool-11-thread-1) JBAS010281: Started repl cache from web container
09:34:26,996 INFO [org.jboss.as.clustering.impl.CoreGroupCommunicationService.web] (MSC service thread 1-2) JBAS010206: Number of cluster members: 1
09:34:27,043 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (MSC service thread 1-1) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:34:27,043 INFO [org.infinispan.config.ConfigurationValidatingVisitor] (MSC service thread 1-1) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:34:27,058 INFO [org.infinispan.jmx.CacheJmxRegistration] (MSC service thread 1-1) ISPN000031: MBeans were successfully registered to the platform mbean server.
09:34:27,058 INFO [org.jboss.as.clustering.infinispan] (MSC service thread 1-1) JBAS010281: Started //default-host//cluster-demo-master cache from web container
09:34:27,074 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (MSC service thread 1-1) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:34:27,089 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (MSC service thread 1-1) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be pasivated.
09:34:27,199 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /cluster-demo-master
09:34:29,011 INFO [org.jboss.modcluster.ModClusterService] (MSC service thread 1-4) Initializing mod_cluster 1.2.0.Final
09:34:29,027 INFO [org.jboss.modcluster.advertise.impl.AdvertiseListenerImpl] (MSC service thread 1-4) Listening to proxy advertisements on 224.0.1.105:23364
09:34:29,043 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "cluster-demo-master.war"
09:34:29,043 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 7828ms - Started 193 of 324 services (130 services are passive or on-demand)
then i had web request http://localhost/cluster-demo-master
which is still sucessfully served by server-three, as shown in the console.(here the order doent matter, as i observed doing this test number of times using two browsers. in some cases server-two takes the lead). which means "session-failover" and "load-balancing" working perfectly untill now.
to prove further, that the session replication is working, now i stoped server-three (current request-serving server). now my new cluster c''' is c'''={server-two}
then i had web request http://localhost/cluster-demo-master
"Service Temporary Unavailable" page appears as discribed in my previous post.
now I shutdown apache HTTPD server, then server-two try coonecting to apache proxy via socket channel fails. log extract is given bellow.
09:50:15,188 INFO [org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) IO error sending command STATUS to proxy localhost/127.0.0.1:10001: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method) [rt.jar:1.6.0_21]
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) [rt.jar:1.6.0_21]
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) [rt.jar:1.6.0_21]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) [rt.jar:1.6.0_21]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) [rt.jar:1.6.0_21]
at java.net.Socket.connect(Socket.java:529) [rt.jar:1.6.0_21]
at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy.getConnection(DefaultMCMPHandler.java:812)
at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy.getConnectionWriter(DefaultMCMPHandler.java:834)
at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.sendRequest(DefaultMCMPHandler.java:479)
at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.sendRequest(DefaultMCMPHandler.java:580)
at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.sendRequest(DefaultMCMPHandler.java:409)
at org.jboss.modcluster.ModClusterService.status(ModClusterService.java:468)
at org.jboss.modcluster.container.catalina.CatalinaEventHandlerAdapter.lifecycleEvent(CatalinaEventHandlerAdapter.java:239)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]
this proves server-two become the active server when server-three is absent and it also has the current session. However mod_cluster configuration at apache side did not respond well in server-shutdown-startup, which may not recognise or were not communicated to apache by jboss AS properly or still session sticky ness causing issues. How can we over come this issue? any fixes in new version or workaround to this issue?