1

I'm trying to loadballance logs to a pool of rsyslog server using HAproxy but I'm failing to find a suitable solution when the source is a single client. HAproxy opens a session to one of the backend server and sends everything his way.

I want to loadballance this single session and every log it sends "round robined" across all to all servers. Configuration is pretty basic, but I can't find what option should I use to enable what I want.

#---------------------------------------------------------------------
# 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

Any pointer would be appreciated.

1
  • 4
    On mobile so I may have missed some detail but generally you can’t load balance a single TCP/IP connection unless the load balancer is sufficiently protocol aware that it can recognize unique individual requests/events in that tcp stream and can separate them out. then you don’t load balance tcp connections anymore, you are a reverse proxy that operates on the application layer rather than the link layer
    – HBruijn
    Dec 12, 2018 at 17:20

0

You must log in to answer this question.

Browse other questions tagged .