To test clustering using a single JBoss instance on a single server,
use the properties jboss.node.name
, jboss.server.data.dir
, and
jboss.socket.binding.port-offset
In one shell, run
$JBOSS_HOME/bin/standalone.sh --server-config=standalone-ha.xml -Djboss.node.name=one -Djboss.server.data.dir=/tmp/one
In another, run
$JBOSS_HOME/bin/standalone.sh --server-config=standalone-ha.xml -Djboss.node.name=two -Djboss.server.data.dir=/tmp/two -Djboss.socket.binding.port-offset=100
Run as many as you like, providing unique values for the name, data directory and port offset to each one.
Now deploy your app as you normally would. All JBoss instances should pick it up. An unfortunate side effect of this technique is that deployed apps will bounce each time you bring up a new server, but that’s hopefully a minor inconvenience.
You'll still have a conflict on jboss.server.log.dir. Maybe it's better to set jboss.server.base.dir.