6 Replies Latest reply on Apr 26, 2004 6:00 PM by lordbritish

    Round robin clustering for HA-RMI on 2 nodes is not even !!!

    lordbritish

      I've created a cluster on 2 nodes using the round robin clustering policy for a HA-RMI service.

      According to the clustering docs, this should alternate the requests from one server to the other one in the cluster.

      This is NOT happening.

      Quite frequently, one of the nodes is favored and all requests (for a while) go to it. Then inexplicably, the requests are balanced among the 2 nodes for a little while. And then later, we're back to having all the request go to the same "favored" server.

      It's not behaving as advertised.

      Please fix this, thx.

      This is with JBoss 3.2.3

        • 1. Re: Round robin clustering for HA-RMI on 2 nodes is not even
          lordbritish

          This is my HA-RMI service below:

          InitialContext ctx = new InitialContext();
          Object obj = ctx.lookup("/HAPartition/DefaultPartition");
          RMISocketFactory rmiSocketFactry = RMISocketFactory.getSocketFactory();
          HAPartition myPartition = (HAPartition) obj;
          MyService myService = new MyServiceImpl();
          HARMIServerImpl rmiserver = new HARMIServerImpl(myPartition, "MyService", MyService.class, myService, 3433, rmiSocketFactry, rmiSocketFactry);
          MyService stub = (MyService) rmiserver.createHAStub(new RoundRobin());
          ctx.bind("RMI_STUB", stub);
          


          As you noticed I'm explicitly using "RoundRobin"

          However, the 2 nodes in my cluster are not using "Round Robin" as I understand it. It's my understanding that "Round Robin" clustering means going from one sever to the next in an even manner (not factoring system load). I'm not sure what load balancing technique is actually being used but it aint "Round Robin" as I've explained it.

          Fail-over is working - when I bring down one of my nodes, all request goes to the remaining node.

          I believe other folks here have noticed this anomaly.

          Is this a bug, or intended behvior ??



          • 2. Re: Round robin clustering for HA-RMI on 2 nodes is not even
            i_n_g

            Can you paste the client code?

            • 3. Re: Round robin clustering for HA-RMI on 2 nodes is not even
              lordbritish

              Here's what I'm doing with the client

              Properties props = new Properties();
              props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
              props.setProperty("java.naming.factory.url.pkgs", "jboss.naming:org.jnp.interfaces");
              props.setProperty("java.naming.provider.url, "node1:2000,node2:2000");
              
              InitialContext ctx = new InitialContext(props);
              MyService myService = (MyService)ctx.lookup("RMI_STUB");
              myService.helloWorld();
              


              I get the stub every time I call the the remote method - perhaps that's the problem. May be I should be reusing the stub??



              • 4. Re: Round robin clustering for HA-RMI on 2 nodes is not even
                i_n_g

                yeah, the HA-RMI only works when you call myService.helloWorld() repeatedly:

                myService = ctx.lookup("RMI_STUB");
                // get the remote stub from first available node

                while (...) {
                myService.helloWorld();
                // the "smart-stub" will distribute the work to the clustering nodes
                }

                • 5. Re: Round robin clustering for HA-RMI on 2 nodes is not even
                  i_n_g

                  The "smart guy" is the "stub", not the namingservice. :-)

                  • 6. Re: Round robin clustering for HA-RMI on 2 nodes is not even
                    lordbritish

                    Oh, ok, thanks a $1,000,000 - i don't really have that but u know what I mean ;)