Link to home
Start Free TrialLog in
Avatar of TeeRoles
TeeRoles

asked on

Load balancing/distribution and failover in JBOSS

Hi all,

I need to develop/use/configure an application server for a JAVA application that I have designed. The application handles both requests from another application server via CORBA as well as from the internet (HTTP).

I would like to use an open source application server like JBOSS in a clustered duplicated configuration.

The two main criterion in the design/configuration of the AS are load balancing and failover. My questions are:

1) What is the best way to achive load balancing (based on processor load) from the CORBA side? The requesting application server can be set up to send request to two nodes, a primary and secondary but it will only send to the secondary if the primary is down, so I need a mechanism to distribute requests equally between the servers.

2) What is the best way to achieve load balancing on the WEB side?    

3) How can I manage failover on the CORBA side. Requests from the CORBA side comes in sessions so there is a need to somehow make sure that the second server has access to data stored by the first server in a request from an earlier session (assuming the first server has died in the meantime).    

4) What is the best mechanism to manage failover, HTTP, RMI, or EBJ (or other)? I guess HTTP might be good enough for the web side, but I do not think it will work on the CORBA side?!?

Thanks in advance

Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi TeeRoles
sorry I don't know about CORBA, bet regarding Java Yes HTTP is good enouph for implementing HTTP Failover, load balancing and session replication.
I didn't try on JBOSS but was quite easy on Application server like orion (www.orionserver.com), the common thing between all of the application server is:
1- Use of Multicasting protocols to replicate session info
2- All Objects stored in sessions should be serializable
3- don't use Servlet application scope
4- in ur web.xml define <destributable />
the rest will be just JBOSS specific configurations, u will need to refer to links like CEHJ provided for such configuration
Avatar of TeeRoles
TeeRoles

ASKER

Hi petmagdy,

Thanks for your input!!! I would just appreciate it if you could clarify a couple of things.

In bullet '1' you mention use of multicast protocols! Could you please expand on what you mean?

Also, I had looked at the web site mentioned earlier and have to admit I am a bit confused!! They mention JNDI, RMI and EBJ with regards to failover and HTTP with regards to session replication. Do you know the difference between failover and session replication? Our applications use RMI extensively and if it is possible we would prefer using this mechanism. Do you know if we can use it in the AS architecture we have described above?

Finally could you give me some idea/links as to how failover (preferably RMI or even HTTP) is implmented/executed?

Thanks in advance!!
Ok,
in order to configure application (AS) server Clustering (Clustering = Load Balancing + failover + session replication), u have to configure mulliple AS instances that are able to communicate and send messages between each other this is done using multicasting protocal, this is seamless to developers we need to not to know more details about.
A simple cluster contains of a load balancer (Hardware or software) that distribute the HTTP traffic between 2 or more AS instances.
Failover means when one instance is down the load balancer detects that and stop sending requests to that instance, but take this scenario a user login in and have a shopping cart date (assume 4 items for example in his shopping cart) that is stored in the Session on one of the AS instances he is seamlessly dealing with, if this instance fails and load balancer switched his requests to the other instance the user will suddenly find that his shopping cart returned to empty!!
that is why session replication is needed by instances replicating the session data between them using multicast protocol
on JBOSS I didn't try the failover before i can only provide links, but on orion will look like this:
http://www.orionserver.com/docs/http-clustering.html
by the way orion is excellent!!!

I like orion over JBOSS
Hi again,

Could you explain software load balancing! Does this mean that if you have two machines in the cluster then one of the machines is dedicated to distributing the load or am I completely off the mark?

Aslo is the load distributed alternatively or based on distribution depending on processor load?

Finally if you do use software load balancing, then will this in any way interfere with the failover?

Thanks!!
ASKER CERTIFIED SOLUTION
Avatar of petmagdy
petmagdy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi petmagdy,

I guess i am just a bit confused about something I read with regards to software load balancing. In the article they mention software load balancing and sticky sessions in which a request from a specific IP address is always directed towards the same server (specifically in regards to SSL).

If this is the case, then what will happen if this server (and hence the sticky connection) goes down? Will the AS still be able to perform failover and recreate this 'sticky connection' on the secondary/other server, or is this session lost becuase of the sticky conection implemented by the softwatre load balancing?

I hope I have clarified my question. Thanks again for all!!
Yes that is why Session replication is needed, as a loadbalancer using sticky connections a user requests is attached to a certian instance, and this instance fails, the loadbalancer will route him to another instance, if session replication is configured correctly he will not lose his session information
Thanks a million!!! that really clarifies quite a lot of concerns i had!!!