In master elections (at least in 3.2.3), it is always the host that's been up longest.
So A and B will always be on the same node assuming your deployment is symmetrical.
This feature was actually causing my problems, so i had to write my own singleton support to do elections differently so they didn't have to all be on the same node.
I have a service that takes 30+ seconds to start, it was killing us that whenever we re-deployed code on the master, the singlton switched to host2 and then immediately back to host1 once the redeploy happened. It was effectively taking us out of service for a full minute every time we re-deployed.
In our case, we used the replicant manager to perform elections. Basically means that the code that's been deployed longest is master. Not the host that's been up longest.
Thanks for your reply.
But what if you have three nodes, and MBean A is only deployed on Node 1 and 2, and MBean B is deployed only on Node 2 and 3? When node 1 comes up first, then MBean B will not become active at all because it´s not running on the master node?