Migration
Migrate from HAProxy to HAProxy Enterprise
Migrate an existing HAProxy (Community edition) load balancer to use HAProxy Enterprise instead with a blue-green deployment strategy.
The following migration strategy is a high-level overview and doesn’t cover every use case or application. You will need to adapt your migration plan to your specific use case. It’s recommended to test a migration plan in a pre-production environment before deploying changes to production.
Notable changes migrating from HAProxy to HAProxy Enterprise:
- The HAProxy Enterprise configuration is located at
/etc/hapee-2.9/hapee-lb.cfg
instead of HAProxy’s/etc/haproxy/haproxy.cfg
- The Runtime API socket is located at
/var/run/hapee-2.9/hapee-lb.sock
instead of HAProxy’s/var/run/haproxy.sock
- The main service file is called
hapee-2.9-lb.service
instead ofhaproxy.service
- The logs are located at
/var/log/hapee-2.9/lb-access-{YEAR,MONTH,DAY}.log
andlb-admin-{YEAR,MONTH,DAY}.log
instead of HAProxy’s/var/log/haproxy.log
In this overview, you are migrating an HAProxy load balancer to a new HAProxy Enterprise load balancer on two different machines; here’s what the example setup looks like:
Prerequisite Jump to heading
Obtain an HAProxy Enterprise license key. Don’t have one? Request a free HAProxy Enterprise trial to obtain your trial license key.
Migrate with a blue-green deployment strategy Jump to heading
-
Install HAProxy Enterprise on a new machine following the Linux Installation procedure.
-
Transfer the necessary contents of the HAProxy configuration file to the new, default HAProxy Enterprise configuration file line-by-line. Here’s a list of recommendations:
- Don’t overwrite the default HAProxy Enterprise configuration file with HAProxy’s configuration file.
- Don’t transfer the
global
section from HAProxy; instead, use the defaultglobal
section that comes with HAProxy Enterprise. - Move necessary HAProxy directories and files to the new machine, and rename them accordingly. These files may include TLS certificates, Map files, and ACL files.
- Update any path names in the HAProxy Enterprise configuration file accordingly.
- Confirm hard-coded IP addresses in the
frontend
section. - Configure the HAProxy Enterprise load balancer to run on a different IP address than the HAProxy load balancer. This allows you to run both products simultaneously and have the ability to rollback if an issue were to arise.
-
Validate the HAProxy Enterprise configuration file.
nix/opt/hapee-2.9/sbin/hapee-lb -c -f /etc/hapee-2.9/hapee-lb.cfg -Vnix/opt/hapee-2.9/sbin/hapee-lb -c -f /etc/hapee-2.9/hapee-lb.cfg -VAlerts 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
. -
Restart the HAProxy Enterprise service.
nixsudo systemctl restart hapee-2.9-lbnixsudo systemctl restart hapee-2.9-lb -
Confirm that the HAProxy Enterprise process is running.
nixsystemctl status hapee-2.9-lbnixsystemctl status hapee-2.9-lb -
Confirm that HAProxy Enterprise is listening on the right ports.
nixss -tlpnnixss -tlpn -
Check the HAProxy Enterprise admin log files at
/var/log/hapee-2.9/lb-admin-{YEAR,MONTH,DAY}.log
for messages about startup and the backend server health checks. -
Perform the migration by diverting traffic from the existing HAProxy load balancer to only the HAProxy Enterprise load balancer using its IP address.
-
Verify no warnings or errors by tailing the HAProxy Enterprise access logs:
nixsudo tail /var/log/hapee-2.9/lb-access-{YEAR,MONTH,DAY}.lognixsudo tail /var/log/hapee-2.9/lb-access-{YEAR,MONTH,DAY}.log -
Perform tests to confirm that your application is working as expected. Divert traffic back to the HAProxy load balancer if issues cannot be addressed.
-
If your application is working as expected and a rollback is no longer needed, then you can tear down HAProxy and the old machine.
If this blue-green deployment strategy is not possible for your use case, contact our Support team to consider alternatives based on your specific needs.
Do you have any suggestions on how we can improve the content of this page?