首页 > 其他 > 详细

HAProxy启动时候常见问题

时间:2018-06-17 15:59:51      阅读:225      评论:0      收藏:0      [点我收藏+]
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

HAProxy启动时候常见问题

原文:http://blog.51cto.com/thinklili/2130170

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!