2 Replies Latest reply on Sep 6, 2011 2:18 AM by gaurav.bhatia81

    Singleton setup in a cluster

    gaurav.bhatia81 Newbie



      I have a query related to singleton HA configuration in a cluster (jboss 5.1)


      Problem : I have two jboss servers part of a cluster. The application (web service) should be deployed on both the servers when they start up. There exists a distributed cache which services on both servers use for returning data to incoming http requests.


      Now, incoming of messages is from a JMS source and i want only one node (master) to read the incoming messages and update the distributed cache. Though both can then use the cache to respond to incoming requests.


      The build is a .war file and would prefer to use that for installation.


      After reading lots of articles and posts, my understanding is :

      - I cannot deploy the war simply in deploy-hasingleton directory (under "all"), as only the master will deploy in that case and other node will only trigger deployment once the master is down (which doesnt satisfy the requirement).


      So, the only solution i can think of is :

      - I should deploy an mbean in deploy-hasingleton folder which just receives callback when the server is selected as master. And the main application deployed under deploy folder on startup should search for the mbean status/deployment (as HASingleton) and act accordingly.


      Is there some way to handle this requirement in a cleaner way.....Appreciate any pointers....




        • 1. Re: Singleton setup in a cluster
          gaurav.bhatia81 Newbie

          ok, first part of the problem i got working :

          It works perfect if i place the war file in deploy-hasingleton folder.....application is deployed on master and not on slave. If the master node goes down, the slave gets notified and the applicaiton is then deployed on the slave node.


          Now, the second part of problem (still unanswered):

          - I need the service to be running on both the nodes (master and slave). Only if the master goes down, the slave should get a callback to start the service. Complete deployment should happen when the nodes start and not wait for master to go down.


          Appreciate if someone can share any experience/thoughts related to this.



          • 2. Re: Singleton setup in a cluster
            gaurav.bhatia81 Newbie

            Just for information of all:

            I had to finally use the shoal framework to meet the requirements.