Get the App
SLTechnology News&Howtos  ›  Servers  › 

Frequently asked questions when HAProxy starts

Shulou Source: shulou.com Published: 2022-06-03 08:35:40 11月12日 Update

When combining rabbitmq and haproxy, the following problems were encountered

Configuration of a section:

Listen rabbitmq_local_cluster 127.0.0.1:5670 mode tcp balance roundrobin server rabbit1 127.0.0.1:5672 check inter 5000 rise 2 fall 3 server rabbit2 127.0.0.1:5673 check inter 5000 rise 2 fall 3 server rabbit3 127.0.0.1:5674 check inter 5000 rise 2 fall 3listen private_monitoring: 8100 mode http option httplog stats enable stats uri / stats stats refresh 5s

Error report:

[ALERT] 167ALERT 151633 (56845): parsing [haproxy.cfg.local_cluster:27]: 'listen' cannot handle unexpected argument' 127.0.0.1 listen' cannot handle unexpected argument 5670mm. [ALERT] 167ALERT 151633 (56845): parsing [haproxy.cfg.local_cluster:27]: please use the 'bind' keyword for listening addresses. [ALERT] 167Accord 15151633 (56845): parsing [haproxy.cfg.local_cluster:40]:' listen' cannot handle unexpected argument': 8100mm. [ ALERT] 167Universe 151633 (56845): parsing [haproxy.cfg.local_cluster:40]: please use the 'bind' keyword for listening addresses.

Modify it to either

Listen rabbitmq_local_cluster bind 127.0.0.1:5670 mode tcp balance roundrobin server rabbit1 127.0.0.1:5672 check inter 5000 rise 2 fall 3 server rabbit2 127.0.0.1:5673 check inter 5000 rise 2 fall 3 server rabbit3 127.0.0.1:5674 check inter 5000 rise 2 fall 3listen private_monitoring bind: 8100 mode http option httplog stats enable stats uri / stats stats refresh 5s

Restart [haproxy-f haproxy.cfg.local_cluster] error:

[ALERT] 167gamma 151959 (58789): Starting frontend GLOBAL: cannot change UNIX socket ownership [/ tmp/haproxy.socket]

Change it to sudo haproxy-f haproxy.cfg.local_cluster.

All configuration: https://github.com/rabbitinaction/sourcecode/blob/master/configs/haproxy/haproxy.cfg.local_cluster

Tags: Configuration timing problems FAQ Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux macOS Redmi Docker MariaDB