1
我试图让HAProxy记录tcp流量我一直在做的没有成功。这里是我的confs:HAProxy将只记录启动消息
/etc/haproxy/haproxy.cfg
global
log /var/lib/haproxy/dev/log local0 debug
chroot /var/lib/haproxy
maxconn 2000
user haproxy
group haproxy
defaults
log /var/lib/haproxy/dev/log local4 debug
mode tcp
option tcplog
option dontlognull
retries 3
option redispatch
timeout connect 5000
timeout client 10000
timeout server 10000
listen sco 0.0.0.0:80
log /var/lib/haproxy/dev/log local4 debug
mode tcp
stats enable
stats uri /haproxy?stats
balance roundrobin
cookie SERVERID insert indirect nocache
server test11 172.21.0.3:8888 check cookie test11
server test12 172.21.0.2:8888 check cookie test12
/etc/rsyslog.d/49-haproxy.conf
$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514
local0.* -/var/log/haproxy/haproxy_0.log
local4.* -/var/log/haproxy/haproxy_4.log
if ($programname == 'haproxy') then -/var/log/haproxy/haproxy.log
& ~
我得到的输出只是代理启动线。
/var/log/haproxy/haproxy.log
Mar 31 18:23:19 74f09d6f9f70 haproxy[27]: Proxy sco started.
/var/log/haproxy/haproxy_4.log
Mar 31 18:23:19 74f09d6f9f70 haproxy[27]: Proxy sco started.
我产生一些流量。 HAProxy正确重定向它,但不会记录任何内容。我不知道发生了什么。
我配置rsyslog现在在该文件中写的,不是HAProxy的 –