6 Replies Latest reply on Apr 24, 2013 10:52 AM by molek

    How to set up a 2node failover cluster with JBoss7.0.2

    akhilachuthan

      I need to set up a JBoss cluster with 2 nodes. Just need any one instance to run at a time. The other one whould pick up if there is a node failure. I believe this is called a failove model.

       

      I am trying to create this setup with JBoss AS 7.0.2, but could not. Was not able to find a friendly guide as well... Can someone please help.

       

      Can i do this with standalone mode by configuring the standalone.xml file?

       

      Thanks in advance

        • 1. Re: How to set up a 2node failover cluster with JBoss7.0.2
          rhusar

          I need to set up a JBoss cluster with 2 nodes. Just need any one instance to run at a time. The other one whould pick up if there is a node failure. I believe this is called a failove model.

          Just to reprhrase this, you want both server to be running and serving request at the same time, but in case one fails, the other one picks up the work.

           

          You will need to make your application distributable and configure AS instances to cluster. See the documentation link below.

           

          I am trying to create this setup with JBoss AS 7.0.2, but could not. Was not able to find a friendly guide as well... Can someone please help.

          This documentation page should help with simple scenario like you want:

           

          https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto

           

          Can i do this with standalone mode by configuring the standalone.xml file?

          You can achieve this with standalone-ha.xml profile (by default), of course you can change your existing xml file to support clustering as well. Clustering is orthogonal to management model, so you can use both standalone and domain operation modes.

           

          HTH

          • 2. Re: How to set up a 2node failover cluster with JBoss7.0.2
            akhilachuthan

            Thanks for response Rodaslav. I shall try out as per this

             

            Regarding the point

             

            "Just to reprhrase this, you want both server to be running and serving request at the same time, but in case one fails, the other one picks up the work."

             

            Is there an option that i have both the nodes are up and running, but at any given time only one node will serve the requests and the other remains inactive. When the active node goes down, the stand-by node takes up and start serving the requests, probably by the same url/ip

            • 3. Re: How to set up a 2node failover cluster with JBoss7.0.2
              rhusar

              Is there an option that i have both the nodes are up and running, but at any given time only one node will serve the requests and the other remains inactive. When the active node goes down, the stand-by node takes up and start serving the requests,

              Theoretically, this should be possible, but it is not very reasonable since 50% of your hardware will rest mostly idle. That means you will serve you clients slower and you will only be able to facilitate cca 50% of the maximum theoretical load. So you typically don't want to do that.

               

              probably by the same url/ip

              You will need a load balancer in front of these instances that will handle the fail over.

               

               

              I am thinking, to set this up, it can be pretty easy for HTTP sessions (EJB clustering and others that's a different story) with mod_cluster. Mod_cluster load-balances requests according to the factor. What you can do, is statically configure the load on one node to say 100 (100% availability) and the backup node to 1 (only 1% of the "capacity" is available). If the first node is available (=have not failed), it will always be chosen as the 1st choice.

              • 4. Re: How to set up a 2node failover cluster with JBoss7.0.2
                molek

                Hello Radoslav,

                Finally I have found the topic I am looking for.

                You wrote:

                 

                Is there an option that i have both the nodes are up and running, but at any given time only one node will serve the requests and the other remains inactive. When the active node goes down, the stand-by node takes up and start serving the requests,

                Theoretically, this should be possible, but it is not very reasonable since 50% of your hardware will rest mostly idle. That means you will serve you clients slower and you will only be able to facilitate cca 50% of the maximum theoretical load. So you typically don't want to do that.

                 

                 

                I would like to set up exactly the same cluster as Akhil and in my situation it is reasonable because there is no problem with the another server being mostly idle (virtualization - and one server is more than enough to serve all clients )

                and - what is much more important to me - there is no problem with logs beeing dispersed among two servers. I have found how this set up can be achieved for HTTP - but is there

                a way to set it for EJB calls? I have standalone clients that make EJB calls to cluster.  The four policies (FirstAvailable, RoundRobin etc)  does not contain the one I am looking for - and I would like to avoid implementing my own.

                • 5. Re: How to set up a 2node failover cluster with JBoss7.0.2
                  wdfink

                  Hi Molek,

                  welcome to the forum.

                   

                  This thread is about AS7, here there is no option for LB policies like FirstAvailable, RoundRobin etc.

                  You can use the ejb-client [1[ or the remote-naming [2].

                  If you setup a cluster or use both instances with [1] there is no option the requests will be distributed to both server and have automatic failover.

                  If you use [2] and use "remote://host1:4447,host2:4447' as providerURL the first server will be used for all requests as long as the server is available.

                  In case of server1 failed it become worse because each lookup neet to check server1 and wait for the timeout to switch to server2.

                  This will make the client performance very slow-

                  Also there are several drawbacks and I recomend to use ejb-client.

                   

                  Another way to achieve such standby is to use clustering features i.e. Sun (OS) here the IP (which is used by the client to connect the server) is mapped in case of server failure.

                   

                  [1] https://docs.jboss.org/author/display/AS71/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project

                  [2] https://docs.jboss.org/author/display/AS71/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project

                  • 6. Re: How to set up a 2node failover cluster with JBoss7.0.2
                    molek

                    Hello,

                     

                    Thank you for this answer. I am using AS5 but still it was worth to read about it in AS7.

                    I will start another topic just for AS5.