1

Being new to Tomcat infrastructure, I am wondering what an advisable setup would be to have two physical machines each running a tomcat instance to be load-balanced and capable of failover to each other? I have seen lots of posts, but to me it is still not clear what the best implementation would be.

Do I need an Apache webserver to achieve this? Or is it better to use a hardware load-balancer? etc.. How do I get the two tomcat servers to form some kind of failover? any remarks would be highly appreciated.

womble
  • 96,255
  • 29
  • 175
  • 230
Marco
  • 121
  • 1
  • 3
  • 1
    Do you want to achieve performance, high availability or both? – ghm1014 Jul 12 '11 at 14:34
  • The ideal situation would be both :), but our goal is also to keep things as simple as possible, this is normally the difficult when trying to achieve both high-performance and high-availability. But availability seems to be some what more important then performance. – Marco Jul 12 '11 at 14:59
  • How many servers do you expect use for this solution? Do you have any limitations on that? – ghm1014 Jul 12 '11 at 15:15
  • 2 expect 2 tomcat servers, 2 mysql servers and 1 storage server to start with. All physical servers. It would ok if we could scale later on offcourse :) – Marco Jul 12 '11 at 15:57
  • http://support.severalnines.com/entries/23612682-Install-HAProxy-and-Keepalived-Virtual-IP- – hookenz Nov 06 '13 at 00:29
  • You will very likely benefit from a web-tier to help handle your static assets and cache; this helps keep your tomcat instance doing useful work and not getting tied up using threads for something that it could be doing better. You might even decide to separate out a web-tier into multiple pieces (eg. ssl-offload on hardware load-balancer, varnish for a caching layer, httpd etc. for web, tomcat for you J2EE container, then you database layers). Vertical layering is easier (than one big complex thing), in my experience, its crossing between silos where things get tricky. – Cameron Kerr Apr 24 '15 at 10:26

1 Answers1

1

http://tomcat.apache.org/tomcat-6.0-doc/balancer-howto.html

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

Nathan Powell
  • 579
  • 2
  • 6
  • Thanks nathan, so i assume that the tomcat solution is the most simple way to to achieve my goals? – Marco Jul 12 '11 at 15:58
  • As far as I can tell from the info you have provided. If you don't need to share sessions then you can ignore the second link. – Nathan Powell Jul 12 '11 at 17:47
  • So use a combination of the load-balancer with apache http is the way to go. Does the load-balancer also give me fail-over then? – Marco Jul 12 '11 at 18:05
  • Again, I don't know your app, but http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html is probably more than enough from they way you have articulated it so far. – Nathan Powell Jul 12 '11 at 19:07