aspose file tools
The moose likes JBoss and the fly likes How to test the failover in a cluster? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » JBoss
Reply Bookmark "How to test the failover in a cluster?" Watch "How to test the failover in a cluster?" New topic
Author

How to test the failover in a cluster?

Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 58
I configured a cluster with 2 Jboss nodes. And I wrote a simple WebService which just printout "Hello World". I deploy this WebService on the nodes.

Assumed calling the WebService is as follow:
http://node1_addr:8080/TestWebService/
and
http://node2_addr:8080/TestWebService/

Now I stop the node1 and try to call up the WebService at node1 with
http://node1_addr:8080/TestWebService/.

I hope this will change over to node2 since they are clustered. But I get error.

What could be wrong?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 4489

You are missing the load balancer. What you are doing right now is sending requests to individual servers. What you really want to do is send your requests to a load balancer and let it decide to which app server instance to forward the request.

This should get you started: http://community.jboss.org/wiki/usingmodjk12withjboss


JBoss In Action
Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 58
So far I understood, load-balancing and clustering are two different things.

I don't want to test the load-balancing since I know how to test it. I just want to test the clustering.

Maybe what I am doing now is wrong. But how can I test the clustering?

I read this article (http://docs.jboss.org/jbossas/jboss4guide/r4/html/cluster.chapt.html). I thought after I added <distributable/> in web.xml I can test the clustering in the way I mentioned earlier.

Regards

This message was edited 2 times. Last update was at by Thomas Chang

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 4489

You are correct in that you can use load balancing without clustering - each app server could work on its own. However, for clustering to work, you need a single point of entry that distributes the load among the cluster - it is this "distributer" that understand the layout of the cluster and provides a single point of entry to the cluster to the clients. And it is this distributor that handles the situation of a server going down and automatically routes traffic to the running servers.

The other possibility is that each client needs to be aware of the cluster and automatically route requests to another server in the cluster if the originally selected server is non responding. In your example, the client that used http://node1_addr:8080, on seeing that node1_addr was down should then try node2_addr. (I recall doing something like this many years ago with a load test client that I wrote.)
Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 58
Hello Peter,

I think you should be one of the authors of the book "jboss in action"? I read the Chapter 12.2.2 "Creating a clustered EJB" and wrote the program. I can test the program locally, that means I start the JBoss locally on my PC and deploy the ejbonto this Jboss. But later as I deployed the ejb to a remote JBoss AS on the LINUX machine and try to run the Client against the remote ejb, I got following errors, though I've set the 'java.naming.provider.url' with the remote IP.

What could e the reason?

This message was edited 1 time. Last update was at by Thomas Chang

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 4489

Double-check the JNDI tree to see how the bean was registered. This will help: http://community.jboss.org/wiki/DisplayTheJNDITreeWithTheJMXConsole
Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 58
Peter Johnson wrote:Double-check the JNDI tree to see how the bean was registered. This will help: http://community.jboss.org/wiki/DisplayTheJNDITreeWithTheJMXConsole


Thanks.

The JNDI is ok. It's the problem of firewall. The firewall blocks the communication between the two machines. It's solved now.
 
 
subject: How to test the failover in a cluster?
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture