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

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
TeeRolesAuthor Commented:
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!!
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

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:
by the way orion is excellent!!!

I like orion over JBOSS
TeeRolesAuthor Commented:
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?

noo, load balancer dosn't necessary need a didicated machine, a mahine can have a loadbalancer and an AS Instance, actually more than one AS instance can reside on a single machine.
Load balancer uses techniques like round robin to distribute HTTP traffic between AS instances.
As far as i know Load balancers usually is not working based on proccessor load

>> Finally if you do use software load balancing, then will this in any way interfere with the failover?
I can't understand ths question

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TeeRolesAuthor Commented:
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
TeeRolesAuthor Commented:
Thanks a million!!! that really clarifies quite a lot of concerns i had!!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.