9 Replies Latest reply on Mar 10, 2005 7:19 PM by ben.wang

    Clustering is not simple

    V Rao G Newbie

      I am using Jboss4.0.1RC2 version. I tried to setup two-node cluster where each node is setup on different Linux machine. I am using out of the box all config. Both of the nodes started independently and never see or communicate each other, instead both are starting independently and listing Number of clustered members are 1 in the logs.
      JBoss documentation http://docs.jboss.org/jbossas/clustering/JBossClustering.pdf is not a big help and it's very discrete.
      Does anybody have step-by-step guidelines right from IP multicasting to JBoss Clustered setup - would really appreciate for sharing.


        • 1. Re: Clustering is not simple
          Steven Peh Newbie

          umm... have not tried jboss 4, but on 3.2.6 its quite straight forward, just start jboss with -c all and the servers can see each other, i have one running on my winxp workstation and another on a solaris 9... would it be your linux box is blocking multicasts or dont have multicast setup properly, are those 2 box on a different network ? Hope this helps a bit..


          • 2. Re: Clustering is not simple
            sanjuthomas Newbie

            Hi Stev,

            Can you please tell the step by step implementaion of clustering. I am looking to implement it in the Linux box. But still dont know how to start.
            Plese help me

            than in advance,

            • 3. Re: Clustering is not simple
              Steven Peh Newbie

              like i said, afaik 3.2.6, clustering is already enabled by default when you star the server with a -c all option. If you start another instance on another machine with a -c all, you can see on the console that both the servers are visible to each other as long as on the network level the multicast address they use are routable between the 2 networks each machine is in..

              The simplest case is for testing would be to put both machines on the same network on the same hub/switch. Also most linux distros will have a firewall installed by default that may block multicasts depending on the options you set when installing... so if you cant get the cluster to work, does not necessarily mean jboss is not working, check your network and your os setting... heh you can even install a linux kernel without multicast support..

              As far as using the clusters, i've so far only tested EJB fail over, basically you just need to configure your EJB as clusterable in the jboss.xml file as such,

              <?xml version="1.0" encoding="UTF-8"?>

              Also, in your ejb lookup code (i.e. the client), you need the following jndi properties


              Notice , we dont specify a provider url i.e. jnp://localhost:1099 because we dont want to be tied to a specific jboss server.

              Anyway thats all i've experienced so far. If you want http fail over and session replication, i believe thats between your web server and tomcat which is another topic altogether. Cheers

              • 4. Re: Clustering is not simple
                Steven Peh Newbie

                oh, on another note, i believe farming is not enabled by default in 3.2.6. So i had to deploy my ejb on each jboss instance manually... you can configure farming but i havent tried so cant help you there..

                • 5. Re: Clustering is not simple
                  sanjuthomas Newbie

                  Thak You Stev.


                  • 6. Re: Clustering is not simple
                    sanjuthomas Newbie

                    Hi Stev,

                    Thank you for the last replay. I did in the the way you said, and the servers communicating each other too. But my problem is I need to deploy an application as EAR. It contains both EJB and JSPs. The EJBs are in a JAR file and JSP and rest in the WAR file. Can I do the fail over feature for my application through just changing the deployment descriptor. Waiting for your replay.

                    Thanx in advance.

                    • 7. Re: Clustering is not simple
                      sanjuthomas Newbie

                      Can any one help me ?

                      • 8. Re: Clustering is not simple
                        Leonardo Ribeiro de Oliveira Newbie

                        stevenpeh ,

                        I post one topic here but nobody replied yet.
                        I am trying to run the clustering service in jboss 3.2.6 and i have one problem to solve: How can i call the cluster? i mean:
                        I know how to call an specific machine in the cluster.
                        For example:

                        Machine 1:
                        Machine 2: , and so on...

                        But i think that i have to call the cluster instead of calling the specific machine.
                        For example: http://cluster_address/projeto/jsp/EnderecoMnt.jsp?ACAO=EXIBIRFLT.
                        This way, i think that the fail over process is possible.

                        can you help me?

                        • 9. Re: Clustering is not simple

                          You are confusing load balancing with fail over. If you are running from the web front, you will need either a hw load balancer or sw load balancer (e.g., Apache mod_jk).

                          Please check http://www.jboss.org/wiki/Wiki.jsp for details.