I want to use HAProxy as load balancing. I want to put two rabbitmq servers for haproxy. Both rabbitmq servers are in a different instance of EC2. I am setting up a HAProxy server by following this link . I work, but the problem is that messages are not published in the roundrobin template. Messages are published on only one server. Is there any other configuration for my requirement?
My setup is in /etc/haproxy/haproxy.cfg
listen rabbitmq 0.0.0.0:5672
mode tcp
stats enable
balance roundrobin
option tcplog
no option clitcpka
no option srvtcpka
server rabbit01 46.XX.XX.XX:5672 check
server rabbit02 176.XX.XX.XX:5672 check
listen web-service *:80
mode http
balance roundrobin
option httpchk HEAD / HTTP/1.0
option httpclose
option forwardfor
option httpchk OPTIONS /health_check.html
stats enable
stats refresh 10s
stats hide-version
stats scope .
stats uri /lb?stats
stats realm LB2\ Statistics
stats auth admin:Adm1nn
Update:
I did some R&D on this and found that HAProxy cycles through the connection on the rabbitmq server. for example: if I request 10 connections, then it will combine 10 connections on my 2 rabbitmq servers and publish a message.
, robin-, , HAProxy. 1000 HAProxy, 500 1, 500 2. , ?
Update:
, HAProxy . serverfault.com