HAProxy Enterprise Documentation 2.2r1

Install the MaxMind module

  1. Log into your account at the MaxMind website and download the GeoIP databases. Copy them to your HAProxy Enterprise server (e.g. /etc/hapee-2.2/GeoIP2-City.mmdb, /etc/hapee-2.2/GeoIP2-ISP.mmdb).

  2. Install the MaxMind module according to your platform:

    $ # On Debian/Ubuntu
    $ sudo apt-get install hapee-2.2r1-lb-maxmind
    $ # On CentOS/RedHat/Oracle/Photon OS
    $ sudo yum install hapee-2.2r1-lb-maxmind
    $ # On SUSE
    $ sudo zypper install hapee-2.2r1-lb-maxmind
    $ # On FreeBSD
    $ sudo pkg install hapee-2.2r1-lb-maxmind
  3. In the global section of your configuration, add the following lines:

        module-load hapee-lb-maxmind.so
        maxmind-load mlock_max 512000000  CITY /etc/hapee-2.2/GeoIP2-City.mmdb  ISP /etc/hapee-2.2/GeoIP2-ISP.mmdb
        maxmind-cache-size 200000
  4. Reload the HAProxy Enterprise configuration to apply the changes.

Discover properties

  1. Install the mmdblookup utility. This utility enables you to perform look ups for IP addresses in a MaxMind database file and learn the structure of the data.

  2. Look up an IP address. For this exercise, the IP value can be any routable address:

    $ mmdblookup --file /etc/hapee-2.2/GeoLite2-City.mmdb --ip

    This returns a JSON document, as shown below. Use the document's structure to find a property to use with the maxmind-lookup converter. For example, to have HAProxy Enterprise look up the English language city name for a client's IP address, use the keys city, names, and en as represented in the JSON returned from mmdblookup:

          "geoname_id": 4792307 <uint32>
             "en": "Washington" <utf8_string>
      // data continues...

Next up

Configure the MaxMind module