This content has been marked as final.
Show 6 replies
-
1. Re: Round robin clustering for HA-RMI on 2 nodes is not even
lordbritish Apr 20, 2004 10:21 PM (in response to 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 Apr 26, 2004 1:36 PM (in response to lordbritish)Can you paste the client code?
-
3. Re: Round robin clustering for HA-RMI on 2 nodes is not even
lordbritish Apr 26, 2004 4:16 PM (in response to 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 Apr 26, 2004 5:56 PM (in response to lordbritish)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 Apr 26, 2004 5:57 PM (in response to lordbritish)The "smart guy" is the "stub", not the namingservice. :-)
-
6. Re: Round robin clustering for HA-RMI on 2 nodes is not even
lordbritish Apr 26, 2004 6:00 PM (in response to lordbritish)Oh, ok, thanks a $1,000,000 - i don't really have that but u know what I mean ;)