Skip to content

Instantly share code, notes, and snippets.

@lilongen
Last active December 20, 2018 09:03
Show Gist options
  • Save lilongen/7d7fa202216554447dee0796afce0161 to your computer and use it in GitHub Desktop.
Save lilongen/7d7fa202216554447dee0796afce0161 to your computer and use it in GitHub Desktop.
haproxy.example.cfg
$ModLoad imudp
$UDPServerRun 514
$FileCreateMode 0644
$FileOwner ha
local0.* /var/log/haproxy.log
local1.* /var/log/haproxy_warn.log
global
daemon
maxconn 2560
pidfile /var/run/haproxy.pid
log 127.0.0.1 local0 info
log 127.0.0.1 local1 warning
listen stats
bind *:1080
mode http
stats refresh 30s
stats uri /stats
stats realm HAProxy\ Stats
stats auth admin:admin
defaults
mode tcp
log global
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend tidb-proxy
mode tcp
bind *:4001
option tcplog
log global
default_backend tidb
backend tidb
server srv212 172.31.0.212:4000
server srv213 172.31.0.213:4000
server srv215 172.31.0.215:4000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment