I hope this thread will be helpful to those who follow in my foot steps as well as getting any advice based on what I have done / documented.
To discuss this thread, please participate here: Ubuntu Forums
HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for very high traffic web sites and powers quite a number of the world's most visited ones
This tutorial will cover how to setup a redundant HAProxy system which will direct traffic to redundant web servers. This will provide high availability when server goes offline...for such things as maintenance tasks.
The proxy servers will route both secured and unsecured web traffic to the web servers and let the web servers determine how they are going to handle SSL rules and certificates. This will make issuing and renewing certificates much less complicated than handling them at the proxy level.
This is an overview image of a highly-available web server platform.
This article covers the web load balancers.
Tools utilized in this process
- Ubuntu Server 18.04.2 LTS, 64-bit
- HAProxy 1.8.8
- Keepalived 1.3.9
- Portable PuTTY 0.71
- VMware vSphere 6.0.0
- VirtualBox 6.0.10
The list below are sources of information that was helpful in the creation of this document.
- HAProxy Documentation
- Keepalived Documentation
- backreference.org - Load balancing and HA for multiple applications
- tecadmin.net - How to Setup HAProxy Load Balancer on Ubuntu 18.04 and 16.04
This documentation will need to make use of some very-specific information that will most-likely be different for each person / location. And as such, this information will be noted in this section. They will be highlighted in red throughout the document as a reminder that you should plug-in your own value rather than actually using these "place-holder" values.
Under no circumstance should you use the actual values listed below. They are place-holders for the real thing. This is just a checklist template you need to have answered before you start the install process.
Wherever you see RED in this document, you need to substitute it for you will use in your environment.
- Internet domain: mysite.mydomain.com -> PublicIP -> Firewall -> 192.168.107.82 (VirtualIP)
- Load Balancer #1 server name: srv-lb1 (master)
- Load Balancer #1 Internal IP address: 192.168.107.83
- Load Balancer #2 server name: srv-lb2 (slave)
- Load Balancer #2 Internal IP address: 192.168.107.84
- Ubuntu Admin ID: administrator
- Ubuntu Admin Password: myadminpass
- Email Server Name (remote): srv-mail
- Email Server Internal IP (remote): 192.168.107.25
- Web Server #1: web1.mydomain.com, Internal IP Address: 192.168.107.91
- Web Server #2: web2.mydomain.com, Internal IP Address: 192.168.107.92
- Web Server #3: web3.mydomain.com, Internal IP Address: 192.168.107.93
Web Servers - Setup three Ubuntu servers for use as the web servers. This tutorial assumes the server was configured according to this tutorial: How to Install Apache Web Server on Ubuntu Server 18.04 LTS
It is also assumed the reader knows how to use the VI editor. If not, you will need to beef up your skill set or use a different editor in place of it.