-
Notifications
You must be signed in to change notification settings - Fork 1
/
haproxy.cfg
97 lines (89 loc) · 3.25 KB
/
haproxy.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
maxconn 4000
user haproxy
group haproxy
master-worker
daemon
# turn on stats unix socket
stats socket /var/run/haproxy/haproxy.sock mode 0600 level admin
master-worker
external-check
userlist controller
user admin insecure-password mypassword
program api
command dataplaneapi --host 0.0.0.0 --port 5555 --config-file /etc/haproxy/haproxy.cfg --transaction-dir /etc/haproxy --reload-cmd "kill -SIGUSR2 1" --reload-delay 5 --userlist controller
no option start-on-reload
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
option tcpka
option log-health-checks
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 2s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
listen stolon-cluster-master
bind *:5440
mode tcp
timeout client 10m
timeout server 10m
log global
option tcplog
balance first
option external-check
external-check path "/usr/bin:/bin"
external-check command /usr/local/bin/pg_is_master.sh
server keeper0 127.0.0.1:10000 check inter 10000 on-marked-down shutdown-sessions
server keeper1 127.0.0.1:10001 check inter 10000 on-marked-down shutdown-sessions
server keeper2 127.0.0.1:10002 check inter 10000 on-marked-down shutdown-sessions
listen stolon-cluster-standby
bind *:5441
mode tcp
timeout client 10m
timeout server 10m
log global
option tcplog
balance roundrobin
option external-check
external-check path "/usr/bin:/bin"
external-check command /usr/local/bin/pg_is_standby.sh
server keeper0 127.0.0.1:10000 check inter 10000 on-marked-down shutdown-sessions
server keeper1 127.0.0.1:10001 check inter 10000 on-marked-down shutdown-sessions
server keeper2 127.0.0.1:10002 check inter 10000 on-marked-down shutdown-sessions