Upgrade

Upgrade HAProxy Enterprise on Docker

You can upgrade HAProxy Enterprise to version 3.1r1 as a Docker container.

Prepare for the upgrade Jump to heading

  1. Issues with the HAProxy Enterprise configuration can cause the load balancer to fail after an upgrade. Even if the service is performing as desired before the upgrade, the upgrade could introduce changes that cause a failure afterward.

    Validate the HAProxy Enterprise configuration file before proceeding with the upgrade. Example: validate the configuration for version 2.9:

    nix
    sudo /opt/hapee-2.9/sbin/hapee-lb -c -f /etc/hapee-2.9/hapee-lb.cfg -V
    nix
    sudo /opt/hapee-2.9/sbin/hapee-lb -c -f /etc/hapee-2.9/hapee-lb.cfg -V
    nix
    sudo docker exec hapee /opt/hapee-2.9/sbin/hapee-lb -c -f /etc/hapee-2.9/hapee-lb.cfg -V
    nix
    sudo docker exec hapee /opt/hapee-2.9/sbin/hapee-lb -c -f /etc/hapee-2.9/hapee-lb.cfg -V

    About the configuration validation command

    • In version 2.8 and earlier, the command indicates a valid configuration by printing Configuration file is valid in addition to setting the zero return status.
    • In version 2.9 and later, the command sets the zero return status for a valid configuration but does not display a message. To display the message, include the -V option on the command line.

    Multiple configuration files

    If you have multiple configuration files in your application, be sure to check them all in the correct order.

    Alerts and warnings that appear in the console output explain the errors encountered. An alert is a fatal condition and prohibits the service from starting. A warning indicates a condition that is not fatal now but may become fatal in the target release. Address all the errors until you receive the successful output: Configuration file is valid.

  2. Preserve application files in the old container by copying them to the host computer. For example, copy the configuration directory for version 2.9:

    nix
    sudo docker cp hapee:/etc/hapee-2.9 ./
    nix
    sudo docker cp hapee:/etc/hapee-2.9 ./

    Copy map files, ACL files, certificates, WAF rule files, and so on.

Upgrade to HAProxy Enterprise 3.1r1 Jump to heading

The following procedure installs a new major version of HAProxy Enterprise.

  1. Log into the hapee-registry.haproxy.com Docker registry, using the key you were given when you registered as the username and password.

    nix
    sudo docker login https://hapee-registry.haproxy.com
    nix
    sudo docker login https://hapee-registry.haproxy.com
  2. Pull the HAProxy Enterprise image.

    nix
    sudo docker pull hapee-registry.haproxy.com/haproxy-enterprise:3.1r1
    nix
    sudo docker pull hapee-registry.haproxy.com/haproxy-enterprise:3.1r1
  3. Stop and remove any previously running HAProxy Enterprise containers:

    nix
    sudo docker stop <OLD CONTAINER NAME>
    sudo docker rm <OLD CONTAINER NAME>
    nix
    sudo docker stop <OLD CONTAINER NAME>
    sudo docker rm <OLD CONTAINER NAME>
  4. Start the new Docker container, referencing the directory containing your applications files as a volume by using the -v flag.

    nix
    sudo docker run \
    --name hapee-3.1 \
    -d \
    -p 80:80 \
    -p 443:443 \
    -p 5555:5555 \
    -v $(pwd):/etc/hapee-3.1r1 \
    --restart=unless-stopped \
    hapee-registry.haproxy.com/haproxy-enterprise:3.1r1
    nix
    sudo docker run \
    --name hapee-3.1 \
    -d \
    -p 80:80 \
    -p 443:443 \
    -p 5555:5555 \
    -v $(pwd):/etc/hapee-3.1r1 \
    --restart=unless-stopped \
    hapee-registry.haproxy.com/haproxy-enterprise:3.1r1

    Review the configuration to ensure HAProxy Enterprise successfully locates application files such as the configuration file, map files, ACL files, TLS certificates, and so on.

  5. Validate the HAProxy Enterprise configuration file against the new version:

    nix
    sudo docker exec hapee /opt/hapee-3.1/sbin/hapee-lb -c -f /etc/hapee-3.1/hapee-lb.cfg -V
    nix
    sudo docker exec hapee /opt/hapee-3.1/sbin/hapee-lb -c -f /etc/hapee-3.1/hapee-lb.cfg -V

    Alerts and warnings that appear in the console output explain the errors encountered. Address all the errors until you receive the successful output: Configuration file is valid.

Do you have any suggestions on how we can improve the content of this page?