haproxy
Installation
SKILL.md
Identity
- Unit:
haproxy.service - Config:
/etc/haproxy/haproxy.cfg - Stats socket:
/run/haproxy/admin.sock - Logs:
journalctl -u haproxy,/var/log/haproxy.log(requires rsyslog; see Pain Points) - User/group:
haproxy(both Debian/Ubuntu and RHEL/Fedora) - Distro install:
apt install haproxy/dnf install haproxy
Key Operations
| Operation | Command |
|---|---|
| Status | systemctl status haproxy |
| Graceful reload (no dropped connections) | sudo systemctl reload haproxy or haproxy -sf $(cat /run/haproxy.pid) -f /etc/haproxy/haproxy.cfg |
| Validate config | sudo haproxy -c -f /etc/haproxy/haproxy.cfg |
| Restart (drops connections) | sudo systemctl restart haproxy |
| Show process info via socket | echo "show info" | sudo socat stdio /run/haproxy/admin.sock |
| Show all backends | echo "show backend" | sudo socat stdio /run/haproxy/admin.sock |
| Show server state | echo "show servers state" | sudo socat stdio /run/haproxy/admin.sock |
Related skills