`
sillycat
  • 浏览: 2527429 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

RabbitMQ Cluster 2019(2)Cluster HA and Proxy

 
阅读更多
RabbitMQ Cluster 2019(2)Cluster HA and Proxy

Set the HA policy for our cluster
> rabbitmqctl -n rabbit1 set_policy ha-all "^" '{"ha-mode":"all"}'
Setting policy "ha-all" for pattern "^" to "{"ha-mode":"all"}" with priority "0" for vhost "/" ...

You can check the exchanges to see the policy is HA-ALL
http://ubuntu-master:15672/#/exchanges

Set Up HAProxy to proxy
Find the latest version from here
http://www.haproxy.org/#down

> wget http://www.haproxy.org/download/1.8/src/haproxy-1.8.20.tar.gz
> tar zxvf haproxy-1.8.20.tar.gz

> make TARGET=generic ARCH=x86_64 USE_PCRE=1
> make install DESTDIR='/home/carl/tool/haproxy-1.8.20' PREFIX=''


> sudo ln -s /home/carl/tool/haproxy-1.8.20 /opt/haproxy-1.8.20
> sudo ln -s /opt/haproxy-1.8.20 /opt/haproxy

Add sbin to the PATH
export PATH="/opt/haproxy/sbin:$PATH"

Check the installation and version
> haproxy -v
HA-Proxy version 1.8.20 2019/04/25
Copyright 2000-2019 Willy Tarreau <willy@haproxy.org>

Prepare the configuration directory
> mkdir conf

The configuration file is as follow:
> cat conf/haproxy.conf
#logging options
global
        log 127.0.0.1 local0 info
        maxconn 5120
        chroot /opt/haproxy
        uid 99
        gid 99
        daemon
        quiet
        nbproc  2
        pidfile /opt/haproxy/haproxy.pid
#load balancing defaults
defaults
       log        global
       #使用4层代理模式,"mode   http"为7层代理模式
       mode       tcp
       #if you set mode to tcp,then you nust change tcplog into httplog
       option     tcplog
       option     dontlognull
       retries    3
       option redispatch
       maxconn 2000
       contimeout      5s
       clitimeout      120s
       srvtimeout      120s
      
#front-end IP for consumers and producters
listen rabbitmq_local_cluster
       bind 0.0.0.0:5670
       #配置TCP模式
       mode      tcp
       #balance url_param userid
       #balance url_param session_id check_post 64
       #balance hdr(User-Agent)
       #balance hdr(host)
       #balance hdr(Host) use_domain_only
       #balance rdp-cookie
       #balance leastconn
       #balance source  //ip
       #简单的轮询
       balance roundrobin
       #rabbitmq集群节点配置
       server rabbit1 ubuntu-master:5672 check inter 5000 rise 2 fall 2
       server rabbit2 ubuntu-master:5672 check inter 5000 rise 2 fall 2
listen monitor
        bind 0.0.0.0:8100
        mode http
        option httplog
        stats enable
        stats uri /stats
        stats refresh 5s

Command to start the haproxy
> sudo sbin/haproxy -f conf/haproxy.conf


Visit the stats Page
http://ubuntu-master:8100/stats

References:
https://objcoding.com/2018/10/19/rabbitmq-cluster/
https://blog.csdn.net/WoogeYu/article/details/51119101
https://juejin.im/entry/5c0fb747e51d4505fe6c4b71
https://www.jianshu.com/p/6376936845ff




分享到:
评论

相关推荐

    RabbitMQ Cluster.docx

    新节点加入时,通常需要使用`rabbitmq-cluster join`命令来指定现有的集群节点,而移除节点则需要使用`rabbitmqctl`工具,这可能涉及数据迁移和状态更新。如果节点出现故障并需要重新加入集群,它必须先被正确地停止...

    k8s部署rabbitmq-cluster集群配置文件和docker镜像文件

    k8s部署rabbitmq-cluster集群配置文件和docker镜像文件,配合文章学习用,有需要可以下载,无需修改直接部署即可

    rabbitmq集群环境搭建

    ### RabbitMQ 集群环境搭建知识点 #### 一、RabbitMQ集群环境搭建概述 在分布式系统中,为了提高消息处理能力与系统的可靠性,通常会采用RabbitMQ集群架构。RabbitMQ集群允许消息发布者将消息发送到任意一个集群...

    docker-rabbitmq-cluster集群搭建

    docker-rabbitmq-cluster集群搭建docker-rabbitmq-cluster集群搭建

    rabbitmq-c vs2019工程

    标题中的“rabbitmq-c vs2019工程”指的是一个基于C++的RabbitMQ客户端库项目,该库已经适配了Visual Studio 2019。RabbitMQ是一种广泛使用的开源消息代理软件,它实现了Advanced Message Queuing Protocol (AMQP)...

    rabbitmq_cluster.zip

    使用ansible安装rabbitmq集群 需要预先实现控制节点的免密操作 参数说明 #rabbitmq rabbitmq安装目录 work_home: /data/test erlang_rpm安装文件名(放在files文件夹内) erlang_rpm: erlang-20.3.7-1.el7.centos....

    kubernetes-rabbitmq-cluster:适用于kubernetes的可部署的Rabbitmq集群

    2. **环境变量和配置**:RabbitMQ的配置可以通过Kubernetes的环境变量传递,例如设置节点间的心跳时间、集群名称等。此外,还可以使用ConfigMap或Secret来管理RabbitMQ的erlang cookie,以确保集群间的节点能够相互...

    rabbitmq-server-windows-3.6.12.zip

    RabbitMQ 3.6.12 is a maintenance release. Upgrades and Compatibility See the "Upgrading clusters" section of the ...To upgrade a RabbitMQ cluster, follow the instructions in RabbitMQ documentation.

    chef-rabbitmq-cluster:厨师食谱,用于配置rabbitmq-cluster。 (Opscode Rabbitmq食谱的包装食谱。)

    ubuntu / trusty64 ubuntu / precise64 厨师/centos-6.5 主厨/debian-7.7属性钥匙类型描述默认['rabbitmq'] ['cluster'] 布尔型['rabbitmq'] ['cluster'] = true,并且需要['rabbitmq'] ['erlang_cookie']来配置...

    rabbitmq-cluster-docker-compose

    带有Docker Compose的RabbitMQ集群 创建一个3节点RabbitMQ集群,其中HAProxy充当负载均衡器。...$ docker exec -ti rabbitmq-node-2 bash -c " rabbitmqctl join_cluster rabbit@rabbitmq-node-1 " $ docker exec

    RabbitMQ消息服务安装使用手册.docx

    本手册将详细介绍如何在Linux环境中安装、配置和使用RabbitMQ,包括与HA-Proxy、KeepAlived和消息插件的集成。 ### 1. 基础知识 #### 1.1 安装准备 首先,确保系统已经安装了必要的依赖包,如`build-essential`、...

    RabbitMQ消息中间件面试专题.pdf

    首先,我们来探究RabbitMQ中的broker与cluster的含义。broker指的是一组或多个Erlang节点的逻辑分组,在这些节点上运行着RabbitMQ应用程序。简而言之,broker就是运行RabbitMQ服务的服务器或者服务集群。而cluster...

    rabbitmq配置文件 rabbitmq.config

    rabbitmq配置文件,用于rabbitmq管理

    RabbitMQ资料RabbitMQ资料

    **RabbitMQ基础** RabbitMQ是一款开源的消息队列系统,基于AMQP(Advanced Message Queuing Protocol)协议,用于在分布式系统中实现可靠的消息传递。它由Erlang语言开发,具有高度可扩展性和高可用性,是许多企业...

    Rabbitmq 默认配置文件模板

    **RabbitMQ 默认配置文件模板详解** RabbitMQ是一款开源的消息队列系统,基于AMQP(Advanced Message Queuing Protocol)协议实现,广泛应用于分布式系统中,用于解耦应用程序,提高系统的可扩展性和容错性。在...

    rabbitmq基础+springboot集成rabbitmq

    **RabbitMQ基础** RabbitMQ是一个开源的消息代理和队列服务器,用于在分布式系统中进行消息传递。它是基于AMQP(Advanced Message Queuing Protocol)协议实现的,提供了高可用性、可扩展性和稳定性。RabbitMQ的...

    Mastering RabbitMQ(PACKT,2016)

    RabbitMQ is one of the most powerful Open Source message broker software, which is widely used in tech companies such as Mozilla, VMware, Google, AT&T, and so on. RabbitMQ gives you lots of fantastic ...

    RabbitMQ笔记.pdf

    RabbitMQ支持集群模式、表达式配置、高可用(HA)模式和镜像队列模型,具备高性能的特性。RabbitMQ的性能优势部分得益于Erlang语言的优秀表现,Erlang最初用于交换机领域,使得RabbitMQ在Broker之间进行数据交互时...

    rabbitmq 3.10.2 window安装包

    2. 确保Erlang安装成功后,再运行"rabbitmq-server-3.10.2.exe",同样按照提示进行RabbitMQ的安装。 3. 安装过程中,可以自定义安装路径,选择是否添加RabbitMQ到系统环境变量,以及是否在启动时自动运行RabbitMQ...

Global site tag (gtag.js) - Google Analytics