Open romangithub1024 opened 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.
I've meet same issue and found such article http://labs.animoto.com/2010/03/10/uptime-with-haproxy/
@119Vik Above link no longer works :(
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
sudo systemctl reload haproxy.service
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.