HAProxy Enterprise Documentation 2.5r1

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.5/GeoIP2-City.mmdb, /etc/hapee-2.5/GeoIP2-ISP.mmdb).

  2. Install the MaxMind module according to your platform:

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

    global
        module-load hapee-lb-maxmind.so
        maxmind-load mlock_max 512000000  CITY /etc/hapee-2.5/GeoIP2-City.mmdb  ISP /etc/hapee-2.5/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.5/GeoLite2-City.mmdb --ip 40.121.152.233

    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:

    {
       "city":
       {
          "geoname_id": 4792307 <uint32>
          "names":
          {
             "en": "Washington" <utf8_string>
          }
       }
      // data continues...
    }

Next up

Configure the MaxMind module