First you'll need to install and configure global server load balancing in order to use global server load balancing with HAProxy Enterprise.
Install the GSLB module
Install the GSLB package according to your platform:
$ # On Debian/Ubuntu $ sudo apt-get install hapee-extras-gslb
$ # On CentOS/RedHat/Oracle/Photon OS $ sudo yum install hapee-extras-gslb
$ # On SUSE $ sudo zypper install hapee-extras-gslb
$ # On FreeBSD $ sudo pkg install hapee-extras-gslb
Edit your configuration file. You can copy over the example template to get started, or use it as a reference. Example:
$ sudo cp /etc/hapee-extras/hapee-gslb-example.conf /etc/hapee-extras/hapee-gslb.conf
Save your configuration, enable and start the GSLB service.
$ sudo systemctl enable hapee-extras-gslb $ sudo systemctl start hapee-extras-gslb
GSLB_LISTENdirective in the
/etc/default/hapee-extras-gslbfile for each IP address and network port pair at which the GSLB should listen for DNS queries. By default, it listens on all IP addresses at
127.0.0.1:153over port 53 and 153. This allows GSLB to handle DNS requests from external clients as well as queries originating from the local machine itself, enabling local DNS resolution and interaction with other services running on the same system. This configuration allows the GSLB service to provide DNS load balancing and resolution services to both local applications and remote clients. You can keep the
GSLB_LISTENparameters on a single line, separated by spaces.
If you would like to implement Geobalancing in your environment, you will need to download a GeoIP database via MaxMind.
Create your account through the MaxMind website and download the GeoIP databases.
Create the directories on your server that will be used to store the data. Copy them to your HAProxy Enterprise server to the new partitions using any file transfer service. For example City and ISP data: