I have a cluster existing 2 boss instances (Jboss EAP 7.3). I defined cluster in standalone mode. One of server is master , and other is slave. If master is alive, all clients should connect to master node. If master is down, clients should switch to slave. I configured activeMQ in master/slave mode. So it is only up in master node. I realized that I should only deploy my jar in master node. Otherwise I have many dependencies error in slave node. Because ACTIVEMQ is not up. I have implemented singleton deployment by adding singleton-deployment.xml under META_INF.
then I run following command in both Jboss instance.Prod1 is master node.
/subsystem=singleton/singleton-policy=clustering-policy:add(cache-container=server)
/subsystem=singleton/singleton-policy=clustering-policy/election-policy=simple:list-add(name=name-preferences, value=PROD_NODE1)
/subsystem=singleton:write-attribute(name=default, value=clustering-policy)
As I expect, deployment was only deployed in master. Then I stopped master node, slave is selected from election policy. My deployment is deployed in slave node.
Then I started master node again, I expected Jboss to stop deployment in slave. and start deployment in master node. But it did not happen.
Why singleton subsystem does not provide this functionality? Am I missing something?
Thanks in advance