rabbitmq nginx 安装配置

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

 

yum install -y nginx

 

vi /etc/nginx/nginx.conf

http同级加入

stream {
    upstream rabbitmq{
        server 192.168.31.71:5672 weight=5 max_fails=1 fail_timeout=2s;
        server 192.168.31.72:5672 weight=5 max_fails=1 fail_timeout=2s;
        server 192.168.31.73:5672 weight=5 max_fails=1 fail_timeout=2s;
    }
    server {
        listen 5672;
        proxy_connect_timeout 1s;
        proxy_timeout 3s;
        proxy_pass rabbitmq;
    }
}

nginx -s reload
 

 

然后就飞吧,轮流停止节点,保证有一个可用即可。

 

 

 

你可能感兴趣的:(rabbitMq)