Working With Haproxy
By Chris Gilbert
Old Article Comments
I exported these from my old wordpress blog, so they are a bit out of date, but I thought I’d keep them around for posterity.
[Andy Dorfman] - Apr 5, 2014 Excellent article. Do you think this setup will work to load balance/failover several nonclustered weblogic instances. In my current setup, i have apache rp listening on port 443 with ssl termination and forwarding everything to weblogics, listening on port 80. Unfortunately the failover is not very smooth. HAProxy sounds like a more robust solution. Can this be accomplished with HAproxy?
[chrisgilbert42] - Apr 5, 2014 Hi Andy. Yes, HAproxy will work in front of a couple of standalone managed servers. In the case of a non-clustered environment though, you might find the problem is to do with the session failover - that won’t work without clustering features enabled. If you aren’t worried about session failover, and have a mostly public web application, then it should work fine. Say you are running two standalone weblogic servers, and you don’t care about session state, then HAproxy can do a decent job of detecting when one is down, and straight away routing traffic to the other. It’s actually a general purpose proxy, it works with any protocol, not just HTTP. If users do have sessions though, then they will have to log in again on the second node. That’s always going to be the case without a cluster though, as the Java servlets hold the session state, and if you don’t replicate them, then the user will lose anything in the session when they switch nodes (this could be shopping cart contents, etc). However, you might also want to look at the Weblogic plugins for Apache, which could help you if you are not already using them. These help route requests to only active managed servers, and have the added advantage that they can automatically resubmit a failed request to another managed server. I have not tried this set up without a cluster, but I think it possibly works OK. Chris
Please comment below. You'll need a GitHub account to add them, but creating one is free.