Hello all,
I've been tearing my hair out trying to get soft-restarts to work reliably, and
have been frustrated for about a week solid. I'm running 1.4.15 on Ubuntu 10.04
amd64, kernel version 2.6.32-32-generic.
The behavior I'm seeing is that -sf restarts will work sporadically from the
command-line.
it prints the output:
[ALERT] 198/213054 (23213) : Starting frontend http-in: cannot bind socket
[ALERT] 198/213054 (23213) : Starting frontend openstack-ssl-in:
cannot bind socket
[ALERT] 198/213054 (23213) : Starting frontend mother-ssl-in: cannot bind socket
[ALERT] 198/213054 (23213) : Starting frontend authoritae-ssl-in:
cannot bind socket
[ALERT] 198/213054 (23213) : Starting frontend encoders-in: cannot bind socket
[ALERT] 198/213054 (23213) : Starting frontend encoders-v2-in: cannot
bind socket
[ALERT] 198/213054 (23213) : Starting frontend redis-in: cannot bind socket
An strace of the restart shows:
17492 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
17492 fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
17492 setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
17492 setsockopt(5, SOL_SOCKET, 0xf /* SO_??? */, [1], 4) = -1
ENOPROTOOPT (Protocol not available)
17492 bind(5, {sa_family=AF_INET, sin_port=htons(6379),
sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in
use)
17492 close(5) = 0
17492 kill(13512, SIGTTOU) = 0
It does this for every frontend I have defined.
my config is:
global
maxconn 32768
pidfile /var/run/haproxy.pid
stats socket /var/run/haproxy-admin.sock uid 0 gid 0 mode 600
daemon
user haproxy
group haproxy
log localhost daemon emerg debug
spread-checks 3
defaults
mode http
retries 3
option redispatch
maxconn 32768
contimeout 5000ms
clitimeout 300000ms
srvtimeout 3000000ms
# backend definitions elided, all of the default_backend lines below
# point to valid backend names
frontend http-in
bind 0.0.0.0:80
monitor-uri /_haproxy_check
default_backend mother
frontend openstack-ssl-in
bind 0.0.0.0:8443
mode tcp
default_backend openstack-ssl-swift
frontend mother-ssl-in
bind 0.0.0.0:11443
mode tcp
default_backend mother-ssl
frontend authoritae-ssl-in
bind 0.0.0.0:10443
mode tcp
default_backend authoritae-ssl
frontend encoders-in
bind 0.0.0.0:3000
default_backend encoders
frontend encoders-v2-in
bind 0.0.0.0:3002
default_backend encoders-v2
frontend redis-in
bind 0.0.0.0:6379
mode tcp
default_backend redis
# -------------------------------------
output of haproxy -vv
[20110718-21.36.25]# haproxy -vv
HA-Proxy version 1.4.8 2010/06/16
Copyright 2000-2010 Willy Tarreau <[email protected]>
Build options :
TARGET = linux26
CPU = generic
CC = gcc
CFLAGS = -O2 -g
OPTIONS = USE_LINUX_SPLICE=1 USE_LINUX_TPROXY=1 USE_PCRE=1
Default settings :
maxconn = 2000, bufsize = 16384, maxrewrite = 8192, maxpollevents = 200
Encrypted password support via crypt(3): yes
Available polling systems :
sepoll : pref=400, test result OK
epoll : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 4 (4 usable), will use sepoll.
I've been going totally crazy trying to get this working. The exact same build
of haproxy on debian lenny seems to restart reliably. I've tried this same
config with 1.4.15 and it exhibits the same behavior. Is there some sysctl I
need to set or something?
Help would be greatly appreciated.
Thanks very much,
Jonathan