欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

rabbitMQ学习笔记【三】-haproxy部署 原创

程序员文章站 2022-06-13 19:31:53
...
一、下载
   https://fossies.org/linux/misc/haproxy-1.8.5.tar.gz

二、安装
   cd /usr/local
   tar -zxvf haproxy-1.8.5.tar.gz
   cd haproxy-1.8.5
   make TARGET=linux2628 ARCH=x86_64 PREFIX=/usr/local/haproxy
   make install PREFIX=/usr/local/haproxy

三、配置
   vi /usr/local/haproxy/sbin/haproxy.cfg
  
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
chroot /usr/local/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user nobody
group nobody
daemon
defaults
mode tcp
log global
#option httplog
option dontlognull
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 600
listen stats
mode http
bind 0.0.0.0:1080
stats enable
stats hide-version
stats uri /haproxyadmin?stats
stats realm Haproxy\ Statistics
stats auth admin:admin
stats admin if TRUE
frontend rabbitmq
bind *:5672
mode tcp
log global
default_backend rabbitmqs
backend rabbitmqs
balance leastconn
server rabbitmq1 192.168.3.9:5672 check port 5672 inter 5000 rise 1 fall 2 maxconn 300
server rabbitmq2 192.168.3.10:5672 check port 5672 inter 5000 rise 1 fall 2 maxconn 300
server rabbitmq3 192.168.3.18:5672 check port 5672 inter 5000 rise 1 fall 2 maxconn 300
   


四、启动
cd /usr/local/haproxy/sbin
./haproxy -f haproxy.cfg

五、统计界面
http://192.168.3.143:1080/haproxyadmin?stats
rabbitMQ学习笔记【三】-haproxy部署 原创 
            
    
    博客分类: 数据交换 haproxy
  • rabbitMQ学习笔记【三】-haproxy部署 原创 
            
    
    博客分类: 数据交换 haproxy
  • 大小: 63.2 KB
相关标签: haproxy