views:

200

answers:

4

I want to develop clustering and load balancing by using j2EE,I want to use two Tomcats in back-end,If any request arrives to my application it should send request to the tomcats based on the load factor.I want to add fail over and session replication to my application. Please suggest..

  1. The API for load balncing and clustering that i have to use and where it should be down loaded from?
  2. What are the books that i can make reference to make my application programming?
  3. Is Apache web server is useful to my application or not?
  4. what are the sites that i have to use for developing my application?
A: 

I believe Tomcat and Apache already have this capability:

http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html

Kristopher Ives
A: 
  1. The API for load balancing and clustering that I have to use and where it should be down loaded from? In my experience, load balancing is best done using hardware like F5 or Cisco ACE routers, not in software.
  2. What are the books that I can make reference to make my application programming? See answer to 1.
  3. Is Apache web server is useful to my application or not? Yes, it's common to put a web server in a DMZ and let it proxy requests into the app server inside the second firewall.
  4. What are the sites that I have to use for developing my application? Can't tell based on the info you provided. It's probably not possible to get an answer to such a broad question here.
duffymo
A: 

There is a good product (open source) called Terracota wich allows you clustering and balance. http://www.terracotta.org/

For download: http://www.terracotta.org/dl/

Aito
+3  A: 

The API for load balancing and clustering that I have to use and where it should be down loaded from?

Clustering is actually part of the Java EE specification and containers should thus offer support for this (understand here: clustering shouldn't involve programming on your side, you just have to follow some rules when developing your Java EE applications).

In the case of Tomcat, have a look at Tomcat's Load Balancer HOW-TO and more precisely the Tomcat Connectors documentation to implement for software load balancing. Note that many companies prefer and use hardware load-balancing solutions (with products like F5 BIG-IP or Nortel Alteon). This will be a bit more expensive though.

For the load-balancing algorithm, simple round-robin is usually used (this would be my recommendation).

For the session fail-over part, you'll need to use a Persistent Manager, very likely the JDBC Based Store implementation. Just don't forget to make the objects you'll put in session Serializable.

What are the books that I can make reference to make my application programming?

Not sure what you mean by application programming but the simple fact that you are asking this question makes me think that you shouldn't implement your own solution but rather use an existing one (software or hardware).

Is Apache web server is useful to my application or not?

For software load-balancing, Apache (+ mod_jk) would be my choice for the web server. Refer to the Tomcat Connectors documentation previously mentioned.

What are the sites that I have to use for developing my application

Again, I'm not sure what you mean by "developing my application" but the links provided so far are good starting point IMO. If you want to go a bit further, maybe check Under the Hood of J2EE Clustering (this is still a good article, even if not really new). For a more specific answer, ask a more specific question :)

Pascal Thivent