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 database servers. This will provide high availability when a database or load balancing server goes offline...for things such as maintenance tasks.
This is an overview image of a highly-available web server platform.
This article covers the database load balancers.
Tools utilized in this process
- Ubuntu Server 18.04.2 LTS, 64-bit
- HAProxy 1.8.8
- Keepalived 1.3.9
- xinetd 184.108.40.206
- 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
- How to setup HAProxy as Load Balancer for MariaDB on CentOS 7
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.
- 192.168.107.166 (VirtualIP)
- Load Balancer #1 server name: srv-lbdb1 (master)
- Load Balancer #1 Internal IP address: 192.168.107.164
- Load Balancer #2 server name: srv-lbdb2 (slave)
- Load Balancer #2 Internal IP address: 192.168.107.165
- Ubuntu Admin ID: administrator
- Ubuntu Admin Password: myadminpass
- Email Server Name (remote): srv-mail
- Email Server Internal IP (remote): 192.168.107.25
- DB Server #1 Internal IP Address: 192.168.107.123
- DB Server #2 Internal IP Address: 192.168.107.124
- DB Server #3 Internal IP Address: 192.168.107.125
Database Servers - Setup three Ubuntu servers for use as the database servers. This tutorial assumes the servers were configured according to this tutorial: How to Install MariaDB Galera Cluster on Ubuntu 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.