Hot Reconfiguration

From: Alan Gutierrez <alan#prettyrobots.com>
Date: Fri, 24 Jun 2011 20:17:46 -0400


I'm unable to do a hot reconfiguration with either 1.5-dev6 or the 1.4.15 that comes with fedora. When I send SIGTTOU, HAProxy stops listening, but the new HAProxy cannot bind. I'm on Fedora 15 on an Amazon EC2 x86_64 micro instance.

I tried binding using a simple Node.js server, but the address is reported as in use.

$ sudo /opt/sbin/haproxy -f /etc/haproxy/postgresql.cfg
$ sudo mv /var/run/hapostgresql.pid /var/run/hapostgresql.pid.old
$ sudo kill -TTOU $(cat /var/run/hapostgresql.pid.old)
$ sudo /opt/sbin/haproxy -f /etc/haproxy/postgresql.cfg
[ALERT] 175/001220 (1441) : Starting frontend postgresql-in: cannot bind socket [10.161.110.150:5432]

lsof shows that HAProxy stops listening:

$ sudo lsof | grep TCP | grep haproxy

haproxy   1434      haproxy    4u     IPv4              22343
0t0        TCP 10.161.110.150:postgres (LISTEN)

$ sudo kill -TTOU $(cat /var/run/hapostgresql.pid.old)
$ sudo lsof | grep TCP | grep haproxy

Nothing for the second run of lsof. Here's my config:

global

     log         /dev/log local2
     log-tag     hapostgresql
     pidfile     /var/run/hapostgresql.pid
     maxconn     250
     user        haproxy
     group       haproxy
     daemon
defaults
     mode                    tcp
     log                     global
     option                  tcplog
     retries                 3
     timeout queue           1m
     timeout connect         10s
     timeout client          1m
     timeout server          1m
     timeout check           10s
     maxconn                 250
frontend  postgresql-in
     mode        tcp
     bind                        10.161.110.150:5432
     default_backend             postgresql-out
backend postgresql-out
     mode        tcp
     retries     300
     balance     roundrobin
     server      postgresql1  alvar.data.south.california.runpup.net:5432

--
Alan Gutierrez
Received on 2011/06/25 02:17

This archive was generated by hypermail 2.2.0 : 2011/06/25 02:30 CEST