您好,登錄后才能下訂單哦!
rabbitmq和haproxy結合時候,遇到了下面問題
某段配置:
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 3
listen private_monitoring :8100
mode http
option httplog
stats enable
stats uri /stats
stats refresh 5s
報錯:
[ALERT] 167/151633 (56845) : parsing [haproxy.cfg.local_cluster:27] : 'listen' cannot handle unexpected argument '127.0.0.1:5670'.
[ALERT] 167/151633 (56845) : parsing [haproxy.cfg.local_cluster:27] : please use the 'bind' keyword for listening addresses.
[ALERT] 167/151633 (56845) : parsing [haproxy.cfg.local_cluster:40] : 'listen' cannot handle unexpected argument ':8100'.
[ALERT] 167/151633 (56845) : parsing [haproxy.cfg.local_cluster:40] : please use the 'bind' keyword for listening addresses.
修改為既可以
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 3
listen private_monitoring
bind :8100
mode http
option httplog
stats enable
stats uri /stats
stats refresh 5s
重新啟動【haproxy -f haproxy.cfg.local_cluster】報錯:
[ALERT] 167/151959 (58789) : Starting frontend GLOBAL: cannot change UNIX socket ownership [/tmp/haproxy.socket]
改成sudo haproxy -f haproxy.cfg.local_cluster 既可以。
全部配置:https://github.com/rabbitinaction/sourcecode/blob/master/configs/haproxy/haproxy.cfg.local_cluster
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。