Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Our setup is to have two front-facing WWW servers using Apache1.3 and mod_jk and two application servers running Tomcat. The frontend servers load balance transparently using sticky_sessions.

However, occasionally we need to check one particular backend server or the other, to troubleshoot synchronization issues (etc). Currently our only solution is to edit the "sticky session" cookie (i.e. changing the server1 in JSESSIONID=1L0NGS3SS10NSTR1NG.server1), but that seems to be inconsistent, and requires some low-level cookie editing.

Is there any better solution for "overriding" the load balancing here?

share|improve this question
add comment

3 Answers

Run Apache on the public-facing servers and use a TCP load balancer to distribute the load. Give each of the frontend servers a unique name on it's own IP address and configure Apache to respond to both the load-balanced hostname and the machine-specific one with the same vhost config. Then you can just hit http://machine1.example.com/ or http://machine2.example.com/ to test each machine.

share|improve this answer
    
I like that idea! Trouble is, we don't have a hardware load balancer, or an intelligent enough firewall to do that balancing--we just load balance on the DNS level--and if we used that trick we'd still need to get the balancer to respect our sticky sessions. Thanks for the good answer though! –  Jeff Bowman Jan 12 '10 at 22:59
    
You don't need a hardware load balancer, just use ldirectord or keepalived on your existing machines. DNS load balancing is bad, for all the usual reasons. Sticky sessions is similarly bad, and is also to be avoided. –  womble Jan 12 '10 at 23:24
add comment

just change your mod_jk configuration and remove one tomcat from the cluster. after doing a graceful restart of your apache, every request goes to the desired tomcat. when you are finished with testing you just put the second tomcat back in configuration and do again a graceful restart of your apache.

you could also change lbfactor of the tomcat which you want to disable and do the same graceful restart.

share|improve this answer
    
Thanks; while this is an absolutely effective solution, I don't think it'll work for our particular problem (we would like to allow people without SSH permissions to do the sync check for us). –  Jeff Bowman Jan 12 '10 at 21:58
    
there is also a way to change lbfactor via web interface, but i'm not sure whether this is available in apache 1.3. –  Christian Jan 12 '10 at 23:05
add comment

In my load balanced configuration the /status app and the /jconsole app both are load balanced, and if I need to see a certain member in my cluster I am able to refresh those two apps repeatedly and it only takes a few refreshes to get the node that I want to examine to respond.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.