Mirantis / openstack-lbaas

Load balancing service for OpenStack
53 stars 10 forks source link

HAProxy reload should be graceful, without traffic interruption #3

Open romangithub1024 opened 12 years ago

romangithub1024 commented 12 years ago

See:

There is a way to reload the config file gracefully, without causing interruption to users – but this is hidden in the great txt based documentation for haproxy. For your delight, here it is:

haproxy -f /etc/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)

All you need to do, is make sure you pass in the correct location for the haproxy configuration file, and the pid.

ghost commented 12 years ago

In the Ubuntu init scripts for gracefull restart haproxy has "reload" command ("service harpoxy reload" or "/etc/init.d/haproxy reload") ($HAPROXY -f "$CONFIG" -p $PIDFILE -D $EXTRAOPTS -sf $(cat $PIDFILE) ). Gentoo has this command too.

119Vik commented 11 years ago

I've meet same issue and found such article http://labs.animoto.com/2010/03/10/uptime-with-haproxy/

brandongalbraith commented 9 years ago

@119Vik Above link no longer works :(

ghost commented 8 years ago

Be warned: the command above may not work as expected in at least version 1.6.3. it will end your service process, but will continue on the commandline. if you press ctrl+c to get the commandline back, you end the haproxy service. better use reload, use iptables to drop syn requests before reloading (remove the iptable rule afterwards) or read http://engineeringblog.yelp.com/2015/04/true-zero-downtime-haproxy-reloads.html

hellobinge commented 5 years ago

sudo systemctl reload haproxy.service