Session clustering

If you go to the $WILDFLY_HOME/standalone/configuration folder, you will see these files:

  • standalone.xml
  • standalone-ha.xml
  • standalone-full.xml
  • standalone-full-ha.xml

standalone.xml is the default, with all default configuration. To build a cluster, we need to use the standalone-ha.xml file (ha comes from high availability), so rename it to end it as standalone.xml.

Then, you start the server. You should not do the following:

$WILDFLY_HOME/bin/standalone.sh

Instead, you should do this:

$WILDFLY_HOME/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0

You should now do the same in whatever other nodes (machines, VMs, containers, and so on) that you want to get into the cluster. Of course, they need to be in the same network. ...

Get Java EE 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.