HAProxy启动时候常见问题

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

转载于:https://blog.51cto.com/thinklili/2130170

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值