我正在尝试使用 HAproxy 将日志负载均衡到 rsyslog 服务器池,但当源是单个客户端时,我找不到合适的解决方案。HAproxy 打开与其中一个后端服务器的会话,并将所有内容发送到该服务器。
我想对这个单个会话进行负载平衡,并将其发送的每条日志“循环”发送到所有服务器。配置非常简单,但我找不到应该使用什么选项来启用我想要的功能。
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 400000
daemon
stats socket /var/run/haproxy.sock mode 600 level admin
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode tcp
log global
option dontlognull
retries 3
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
maxconn 40000
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend main *:26514
bind *:26514
default_backend nodes
option tcplog
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend nodes
balance roundrobin
option tcp-check
option tcplog
server s1 1.2.2.2:26514 check port 26514
server s2 1.2.2.2:26514 check port 26514
server s3 1.2.2.2:26514 check port 26514
server s4 1.2.2.2:26514 check port 26514
任何指示都将不胜感激。