Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #---------------------------------------------------------------------
- # Global settings
- #---------------------------------------------------------------------
- global
- description PostgreSQL Database HAProxy Stats page
- log 127.0.0.1 local0 info
- chroot /var/lib/haproxy
- pidfile /var/run/haproxy.pid
- maxconn 3000
- user haproxy
- group haproxy
- daemon
- # turn on stats unix socket
- stats socket /var/lib/haproxy/stats
- #---------------------------------------------------------------------
- # common defaults that all the 'listen' and 'backend' sections will
- # use if not designated in their block
- #---------------------------------------------------------------------
- defaults
- log global
- retries 2
- timeout client 30m
- timeout connect 4s
- timeout server 30m
- timeout check 5s
- #---------------------------------------------------------------------
- # stats page
- #---------------------------------------------------------------------
- listen statspage
- mode http
- bind *:7000
- stats enable
- stats uri /
- stats refresh 30s
- stats auth admin:admin
- stats show-desc
- stats show-legends
- #---------------------------------------------------------------------
- # postgresql databases
- #---------------------------------------------------------------------
- listen postgresql
- mode tcp
- bind 0.0.0.0:5000
- timeout client 20m
- timeout connect 1s
- timeout server 20m
- option tcplog
- balance leastconn
- option log-health-checks
- option tcpka
- option tcplog
- option httpchk GET /pgcheck/username/haproxy/port/5432 # checker’s settings
- http-check send-state
- server pg01 171.90.1.2:5432 weight 1 check addr 171.90.1.2 port 8080 inter 5000 rise 2 fall 3
- server pg02 172.90.1.3:5432 weight 1 check addr 172.90.1.3 port 8080 inter 5000 rise 2 fall 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement