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.
Thanks, Carlo, but j.s.base.dir presents other challenges, mostly around convenient deployment, since there is now one deployments/ dir per instance, and the immutant/torquebox deployment tools don't honor j.s.base.dir. Perhaps they should, but even so, I like being able to deploy once, ala a poor-man's "domain mode". Besides, I kinda like the single, common server.log file. I was a little surprised it worked, tbh, but I see messages from each server in there.