Skip to content

Instantly share code, notes, and snippets.

@odoucet

odoucet/haproxy-sample.cfg

Last active May 26, 2016
Embed
What would you like to do?
HAProxy 1.6.5 bug with "show servers state"
global
chroot /tmp
daemon
group users
user nobody
pidfile /var/run/haproxy.pid
log xxx local2 notice
nbproc 4
server-state-file /tmp/haproxy_server_state
# Stats socket
stats socket /var/run/haproxy-1.sock process 1
stats socket /var/run/haproxy-2.sock process 2
stats socket /var/run/haproxy-3.sock process 3
stats socket /var/run/haproxy-4.sock process 4
defaults
maxconn 65536
timeout connect 5s
timeout client 5s
timeout server 5s
listen test:8080
id 42
bind 127.0.0.1:8080
bind-process 1 2
mode http
server s100 127.0.0.1:80
server s101 127.0.0.1:80
server s102 127.0.0.1:80
listen test2:8081
id 43
bind 127.0.0.1:8081
bind-process 3
mode http
server s200 127.0.0.1:80
server s201 127.0.0.1:80
server s202 127.0.0.1:80
#### THIS FIRST OUTPUT IS OK
$ socat /var/run/haproxy-2.sock - <<< "show servers state"
1
# be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_since_last_change srv_check_status srv_check_result srv_check_health srv_check_state srv_agent_state bk_f_forced_id srv_f_forced_id
42 test:8080 1 s100 127.0.0.1 2 0 1 1 23 1 0 1 0 0 1 0
42 test:8080 2 s101 127.0.0.1 2 0 1 1 23 1 0 1 0 0 1 0
42 test:8080 3 s102 127.0.0.1 2 0 1 1 23 1 0 1 0 0 1 0
#### THIS SECOND OUTPUT IS WRONG, BACKENDS ARE NAMED s2XX
$ socat /var/run/haproxy-3.sock - <<< "show servers state"
1
# be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_since_last_change srv_check_status srv_check_result srv_check_health srv_check_state srv_agent_state bk_f_forced_id srv_f_forced_id
43 test2:8081 1 s100 127.0.0.1 2 0 1 1 26 1 0 1 0 0 1 0
43 test2:8081 2 s101 127.0.0.1 2 0 1 1 26 1 0 1 0 0 1 0
43 test2:8081 3 s102 127.0.0.1 2 0 1 1 26 1 0 1 0 0 1 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.