Score:0

I have load balancer configured on Haproxy. Can load balancer redirect traffic from port 1 backend to port 2 backend if port 1 is busy this moment

cw flag

In ha-proxy I separated my traffic to two frontend ports and created two backends. Port-1 traffic is directed both backend and port 2 traffic is directed two backend-2. I want to create a smart load balancer that detects if backend 2 is busy whit port 2 queries it will automatically send the traffic of port 1 to backend 1.

global
       log /dev/log    local0
       log /dev/log    local1 notice
       maxconn 3000
       user haproxy
       group haproxy
       daemon
       stats socket /etc/haproxy/haproxysock level admin
#       external-check
 
defaults
       log     global
       timeout connect 60000
       timeout client 6000000
       timeout server 6000000
       errorfile 400 /etc/haproxy/errors/400.http
       errorfile 403 /etc/haproxy/errors/403.http
       errorfile 408 /etc/haproxy/errors/408.http
       errorfile 500 /etc/haproxy/errors/500.http
       errorfile 502 /etc/haproxy/errors/502.http
       errorfile 503 /etc/haproxy/errors/503.http
       errorfile 504 /etc/haproxy/errors/504.http
 
#########################
frontend test_1
       mode tcp
       bind 0.0.0.0:74474   
         
       acl dp1 dst_port 34475
       use_backend test_two if dp1
       default_backend test_one
 
backend test_one
       balance leastconn
       mode tcp
#       option external-check
 
       option allbackups
 
       server server-1 192.128.22.1:25554 check
       server server-2 10.128.66.53:25554 check
     
backend test_two
       balance leastconn
       mode tcp
#       option external-check
 
       option allbackups
 
       
       server server-1 192.168.22.1:25554 check
     
Score:0
in flag

frontend binds to port 74474 and has an acl based on port 34475 which will never get hit because tthat front end isnt binding to it.

mforsetti avatar
tz flag
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/516989)
richv avatar
in flag
i guess im confused as what 'busy' means and as what the purpose of the backend 1 vs backend 2 if 1) backend 1 will never be reached because the ACL will never be hit and 2) backend 1 and 2 both have 192.128.22.1:25554 as a node? lastly ... .what does 'busy' mean? like the node is down or unresponsive? In which case, you should define one of your nodes as a backup.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.