Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.21 KB

haproxy.rst

File metadata and controls

40 lines (29 loc) · 1.21 KB

HAProxy

Save Current Stata / Reload

Sample HAProxy Config

global
    ...
    # Binds a UNIX socket to <path>
    stats socket /var/run/haproxy.sock
    # Specifies the path to the file containing state of servers.
    server-state-file /etc/haproxy/haproxy.state
    ...

defaults
    ...
    # This directive points HAProxy to a file where server state from previous
    #  running process has been saved
    load-server-state-from-file global
    ...

Reload HAProxy with previous state

socat /var/run/haproxy.sock - <<< "show servers state" > /etc/haproxy/haproxy.state; service haproxy reload; rm -f /etc/haproxy/haproxy.state