Working With Haproxy
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] - 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] - 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
Working With Haproxy
Although I have worked with enterprise envrionments running Oracle and SQL Server for quite a few years, I’ve yet to be involved in a real high-availability deployment. This has been for a variety of technical reasons in our company’s application, and a lack of interest from most customers. Recently, I explored options and had the opportunity to test some load balancing setups for our application servers at a customer site. I was impressed with the reliability and reputation of the HAproxy software, so had a look at that to begin with. In the past this software has been unable to terminate SSL connections, and had to deploy help from other applications in order to achieve that. The latest versions have SSL support though, and aside from a bit of compiling from source, are easy to install. Here’s how I did it, on Centos 6.4.