Improve haproxy.cfg (#473)

* Use more readable 'listen' section
* Explicitely defined check options
* Enable stats dashboard
* Close HAProxy connections to a backend server when it's marked as down.
This commit is contained in:
Andrey Martyanov
2017-07-13 12:09:28 +02:00
committed by Alexander Kukushkin
parent acc6d7c2c2
commit 2877f75288
+18 -14
View File
@@ -1,21 +1,25 @@
global global
maxconn 100 maxconn 100
defaults defaults
log global log global
mode tcp mode tcp
retries 2 retries 2
timeout client 30m timeout client 30m
timeout connect 4s timeout connect 4s
timeout server 30m timeout server 30m
timeout check 5s timeout check 5s
frontend ft_postgresql listen stats
bind *:5000 mode http
default_backend bk_db bind *:7000
stats enable
backend bk_db stats uri /
option httpchk
listen batman
bind *:5000
option httpchk
http-check expect status 200
default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions
server postgresql_127.0.0.1_5432 127.0.0.1:5432 maxconn 100 check port 8008 server postgresql_127.0.0.1_5432 127.0.0.1:5432 maxconn 100 check port 8008
server postgresql_127.0.0.1_5433 127.0.0.1:5433 maxconn 100 check port 8009 server postgresql_127.0.0.1_5433 127.0.0.1:5433 maxconn 100 check port 8009