keepalived moves a VIP to the backup node, but HAProxy on that node fails to start with `cannot bind socket [10.0.1.100:443]`.
IntermediateTroubleshootingSockets, ports, TIME_WAIT and conntrack
Answer
Likely causes → HAProxy starts before the VIP is assigned to the node (it's on the master), and Linux refuses to bind to an address that isn't local (EADDRNOTAVAIL).
Diagnose →
ip addr show | grep 10.0.1.100
sysctl net.ipv4.ip_nonlocal_bind
journalctl -u haproxy | grep -i bind
Fix → Allow binding to non-local addresses so HAProxy runs on both nodes all the time:
echo 'net.ipv4.ip_nonlocal_bind = 1' | sudo tee /etc/sysctl.d/90-vip.conf
sudo sysctl --system && sudo systemctl restart haproxy
Alternatively bind to *:443 and filter by destination in ACLs.
Prevent → Test failover regularly; with ip_nonlocal_bind both proxies are warm and failover is only an ARP update.
More on Sockets, ports, TIME_WAIT and conntrack
`dmesg` is full of `nf_conntrack: nf_conntrack: table full, dropping packet` and new connections randomly time out.Intermediate`ss -s` on a reverse proxy shows 40,000 sockets in `TIME_WAIT`. Is that a problem?BeginnerAn app server's `CLOSE_WAIT` count grows steadily until the service logs `Too many open files`.IntermediateLogs show `accept4(): Too many open files` and the service stops accepting connections.Beginner`dmesg` shows `TCP: request_sock_TCP: Possible SYN flooding on port 443. Sending cookies.`Intermediate`ss -ltn` shows the listener for port 8080 with `Recv-Q 129` and `Send-Q 128`, and clients hang on connect.Advanced