Rabbitmq + haproxy

Source: Internet
Author: User
Tags nginx reverse proxy haproxy

I originally intended to directly use nginx reverse proxy and found that it is not easy to use. Persistent connections are not supported by default. For more information, see haproxy. Just try it ~

wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.21.tar.gztar -zxvf haproxy-1.4.21.tar.gz cd haproxy-1.4.21make TARGET=linux26 PREFIX=/usr/localmake install PREFIX=/usr/localcp haproxy-1.4.21/examples/haproxy.cfg /etc/haproxy.cfg

Vim/etc/haproxy. cfg:

global        log 127.0.0.1  alert debug        #log loghost    local0 info        maxconn 4096        #chroot /usr/share/haproxy        uid 99        gid 99        daemon        #debug        #quietdefaults        log     global        mode    http        option  dontlognull        retries 3        option  redispatch        maxconn 2000        contimeout      5000        clitimeout      50000        srvtimeout      50000listen  rabbitmq 0.0.0.0:56720        mode    tcp        balance roundrobin        option  tcpka        server  rabbit1 192.168.1.93:5672 check inter 5000 downinter 500        server  rabbit2 192.168.1.94:5672 check inter 5000 

Port 56720 of the current machine and port 5672 of the proxy 93 and 94 rabbit machines are used.

Run in daemon mode:

Haproxy-F/etc/haproxy. cfg-d

BTW: no detailed tests and tuning have been performed.

---------------------------------------------- I am a split line ---------------------------------------------------

References:

Http://haproxy.1wt.eu/

Http://blog.chenlb.com/2009/06/install-haproxy-and-configure-load-balance.html

Http://www.joshdevins.net/2010/04/16/rabbitmq-ha-testing-with-haproxy/

Http://blog.chinaunix.net/uid-10249062-id-163273.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.