-
1. Rebalance the request after a node restart
jfclere Jan 21, 2011 3:11 AM (in response to zmb668)That is the purpose of sticky session!
-
2. Rebalance the request after a node restart
zmb668 Jan 22, 2011 2:02 PM (in response to jfclere)Okay, I reckon I asked in a wrong way. My prolem is when I restart one of the 2 nodes, because the sticky session, all of the request is routed to only one node, the another one is idle. Is there any way to ask mod_cluster to redistribute the requests accross the cluster in this case?
-
3. Rebalance the request after a node restart
jfclere Jan 24, 2011 2:47 AM (in response to zmb668)Don't sticky session and cluster the 2 nodes.
-
4. Rebalance the request after a node restart
pferraro Jan 24, 2011 3:36 PM (in response to zmb668)You can't redistribute sessions that are already stuck to a server - however, requests for new sessions will end up getting directed to your newly started node, until mod_cluster determines that the load is even.
N.B. Like Jean-Frederic said, you can disable stick sessions, but if you do this, you should also switch to synchronous web session replication (the default mode is asynchronous). Otherwise, if 2 sequential requests for the same session hit different nodes, the 2nd request could arrive before the replication from the 1st request completes.
There are a number of ways to switch to sync replication:
1. Override the cache-name in jboss-web.xml
e.g.
<jboss-web>
<replication-config>
<cache-name>web/sync</cache-name>
</replication-config>
</jboss-web>
2. Override the cache-mode in jboss-web.xml
e.g.
<jboss-web>
<replication-config>
<replication-mode>SYNCHRONOUS</replication>
</replication-config>
</jboss-web>
3. Change <async/> to <sync/> in the default cache config of the "web" cache container in infinispan-configs.xml itself. N.B. this will change the default replication mode for all web applications!
-
5. Rebalance the request after a node restart
zmb668 Jan 25, 2011 11:54 AM (in response to pferraro)Okay, I got it now. Thanks to both of you for the help.