网站建设资讯

NEWS

网站建设资讯

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

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站栏目:HAProxy启动时候常见问题-创新互联
路径分享:http://cdweb.net/article/eshei.html