• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Tomcat to Apache Connection

 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a few questions regarding connecting Tomcat to Apache.

In our system we have a hardware load balancer that talks to our different Tomcat servers, let's say Tomcat1, Tomcat2, Tomcat3 and Tomcat4. We are introducing session replication in it and hence, we are planning to add Apache Web Server in between hardware load balancer and tomcat.

We have tested that it works if we have 1 Apache server or 4 apache servers containing mod_jk module so that Apache can do the session replication between tomcats.

My first question is, can this be done the other way round? Can Apache run in the background and Tomcat stay in between load balancer and apache? I thought it's not possible but I wanted to be sure. In this case load balancer will forward the request to Tomcat and tomcat will forward the request.

If the answer to the above question is NO, in the first case do you prefer 1 apache server bs 2 apache servers vs 4 apache servers? I like the 2 apache approach.



 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat doesn't forward to Apache. Apache can forward to Tomcat. If an app needs resources in both Tomcat and Apache, the two servers should be load-balanced separately and Tomcat and Apache would both connect directly to the load balancer.

However, that's usually not a good solution. Better to set up Apache to forward to Tomcat, and connect the load balancer only to Apache.

The Apache/tomcat connector itself supports load balancing, so you can load balance using the hardware to a set of Apache servers which in turn use mod_jk balanced connections to a cluster of Tomcat servers.
 
Why is the word "abbreviation" so long? And this ad is so short?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic