3 Replies Latest reply on Jan 21, 2003 6:39 PM by johntran777

    Load Balancing and Fail-over not working

    johntran777

      Hi, I just purchased the documentation from JBoss and tried to do clustering but it does not seem to work. Here is what I do, I use the default setting for the partition



      and default HAJNDI


      jboss:service=DefaultPartition


      In my ejb-jar.xml I add True for every stateless session and entity bean. I deploy them using "all" configuration.

      For the client side(not on the same machines as the jboss servers),
      my jndi.properties has
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

      to do auto discovery.

      When I deploy this on 2 Linux boxes, JBoss does show that it's recognizing the clustering, but when I have clients hit it, sometimes I see it hitting exclusively only one jboss server, the other time it hits the other server only at the beginning of the run and then hits exclusively on this one jboss server for the rest of the time. So there's no round-robin going on. When I killed the server(the one that's getting hit exclusively), the client says that it can not connect to the box, so the fail-over does not work. However if I closed down the client and open it again, now it knows that the server is down and only hits the one that's still alive. I follow the documentation's Trouble Shooting section and go through them, it seems that my boxes have no problem with multicasting, no firewall at all, the clients are on other separate machines. Please help me, because I need to get this into production really soon. Thanks.

        • 1. Re: Load Balancing and Fail-over not working
          tallpsmith

          How are you creating your home/remote interfaces? There is a section in the docs that says if you keep creating your home interfaces, it's constantly redetermining all the nodes in the cluster, and it "forgets" what the last node was used for the remote request, and so it's constantly using the first one in the list.

          I've got it to work by doing exactly as you have done, but explictly doing the home lookup once, and keeping that reference and using it to create new remote interfaces, and my tests show that it round robins through the cluster.

          cheers,

          Paul Smith

          • 2. Re: Load Balancing and Fail-over not working
            johntran777

            I create all my home and remote beans as singletons so they only get created once. One interesting thing is when I add a third node to the clustering, I do see there's a round-robin, but it binds a certain stateless session bean to a certain server, and this bean only gets executed on this server only all the time, and when I kill this server and try to invoke something on this bean, it gives me a "Connection refuse..." error, so it seems like there's no fail-over. I thought it would contact another server to do the service instead. Please explain. Thanks.

            • 3. Re: Load Balancing and Fail-over not working
              johntran777

              It's all working now. It's was all my fault that it was not working. It was because added the tag to the wrong file, it should be jboss.xml.