RabbitMQ(10)Update Version and Cluster Configuration
1. Installation and Update Check
Check the erlang version first
>erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 5.10.4
I have the rabbitmq here rabbitmq -> /opt/rabbitmq-3.1.5
Message Acknowledgment
Message acknowledgments are turned on by default. autoAck=true flag will turned them off.
boolean autoAck = false;
channel.basicConsume(TASK_QUEUE_NAME, autoAck, consumer);
When RabbitMQ quits or crashes it will forget the queues and messages unless you tell it not to. We need to mark both the queue and messages as durable.
boolean durable = true;
channel.queueDeclare("hello", durable, false, false, null);
Set the message to persistent
channel.basicPublish("", TASK_QUEUE_NAME,
MessageProperties.PERSISTENT_TEXT_PLAIN, message.getBytes());
The persistence guarantees aren't strong, but it's more than enough for our simple task queue. If you need a stronger guarantee you can wrap the publishing code in a transaction.
Fair dispatch
In order to defeat that we can use the basicQos method with the prefetchCount = 1 setting. This tells RabbitMQ not to give more than one message to a worker at a time. Or, in other words, don't dispatch a new message to a worker until it has processed and acknowledged the previous one. Instead, it will dispatch it to the next worker that is not still busy.
int prefetchCount = 1;
channel.basicQos(prefetchCount);
Update the version to 3.3.1
>sudo ln -s /Users/carl/tool/rabbitmq_server-3.3.1 /opt/rabbitmq-3.3.1
>sudo ln -s /opt/rabbitmq-3.3.1 /opt/rabbitmq
Start the Server
>sudo sbin/rabbitmq-server
Check and Stop the Server
>sudo sbin/rabbitmqctl status
>sudo sbin/rabbitmqctl stop
2. Start the Cluster of RabbitMQ and Using HA-Proxy
http://flyingdutchman.iteye.com/blog/1912690
http://sillycat.iteye.com/blog/2037218
I already have the .erlang.cookie set up.
>chmod 777 ~/.erlang.cookie
>chmod 400 ~/.erlang.cookie
>sudo chown -R carl ~/.erlang.cookie
>sudo chgrp -R staff ~/.erlang.cookie
>enable rabbitmq_management
The following plugins have been enabled: mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_management_agent rabbitmq_management Plugin configuration has changed. Restart RabbitMQ for changes to take effect.
Start the Nodes
>sudo RABBITMQ_NODE_PORT=5672 RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15672}]" RABBITMQ_NODENAME=rabbit1 sbin/rabbitmq-server -detached
>sudo RABBITMQ_NODE_PORT=5673 RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15673}]" RABBITMQ_NODENAME=rabbit2 sbin/rabbitmq-server -detached
Check status
>sbin/rabbitmqctl -n rabbit2 cluster_status
Cluster status of node rabbit2@sparkworker1 ... [{nodes,[{disc,[rabbit2@sparkworker1]}]}, {running_nodes,[rabbit2@sparkworker1]}, {cluster_name,<<"rabbit2@sparkworker1">>}, {partitions,[]}] ...done.
>sbin/rabbitmqctl -n rabbit1 cluster_status
Cluster status of node rabbit1@sparkworker1 ... [{nodes,[{disc,[rabbit1@sparkworker1]}]}, {running_nodes,[rabbit1@sparkworker1]}, {cluster_name,<<"rabbit1@sparkworker1">>}, {partitions,[]}] ...done.
We can visit the UI Admin Page
http://localhost:15672/#/
http://localhost:15673/#/
Default username and password is guest/guest
Stop and Make the Second Node join Cluster
>sudo sbin/rabbitmqctl -n rabbit2 stop_app
>sbin/rabbitmqctl -n rabbit2 join_cluster rabbit1@sparkworker1
>sudo sbin/rabbitmqctl -n rabbit2 start_app
>sbin/rabbitmqctl -n rabbit1 cluster_status
Cluster status of node rabbit1@sparkworker1 ... [{nodes,[{disc,[rabbit1@sparkworker1,rabbit2@sparkworker1]}]}, {running_nodes,[rabbit2@sparkworker1,rabbit1@sparkworker1]}, {cluster_name,<<"rabbit1@sparkworker1">>}, {partitions,[]}] ...done.
The should be running on 127.0.0.1:5672, 127.0.0.1:5673
I will be working on to put a ha-proxy in front of rabbitmq.
References:
RabbitMQ 1 ~ 9
http://sillycat.iteye.com/blog/1565771 Installation from sources on redhat
http://sillycat.iteye.com/blog/1567052 Installation on ubuntu and redhat
http://sillycat.iteye.com/blog/1575002 Installation on CentOS
http://sillycat.iteye.com/blog/1575314 Java Client - Work Queue
http://sillycat.iteye.com/blog/1575816 Java Client - Publish/Subscribe
http://sillycat.iteye.com/blog/1578635 Java Client - Routing
http://sillycat.iteye.com/blog/1579464 Java Client - Topics
http://sillycat.iteye.com/blog/1582971 Java Client - RPC
http://sillycat.iteye.com/blog/2037218 MAC with Scala and Cluster
http://www.rabbitmq.com/install-generic-unix.html
http://flyingdutchman.iteye.com/blog/1912690
- 浏览: 2542969 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
发表评论
-
Update Site will come soon
2021-06-02 04:10 1672I am still keep notes my tech n ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 289Hadoop Docker 2019 Version 3.2. ... -
Nginx and Proxy 2019(1)Nginx Enable Lua and Parse JSON
2019-12-03 04:17 441Nginx and Proxy 2019(1)Nginx En ... -
Data Solution 2019(13)Docker Zeppelin Notebook and Memory Configuration
2019-11-09 07:15 284Data Solution 2019(13)Docker Ze ... -
Data Solution 2019(10)Spark Cluster Solution with Zeppelin
2019-10-29 08:37 245Data Solution 2019(10)Spark Clu ... -
AMAZON Kinesis Firehose 2019(1)Firehose Buffer to S3
2019-10-01 10:15 315AMAZON Kinesis Firehose 2019(1) ... -
Rancher and k8s 2019(3)Clean Installation on CentOS7
2019-09-19 23:25 308Rancher and k8s 2019(3)Clean In ... -
Pacemaker 2019(1)Introduction and Installation on CentOS7
2019-09-11 05:48 336Pacemaker 2019(1)Introduction a ... -
Crontab-UI installation and Introduction
2019-08-30 05:54 447Crontab-UI installation and Int ... -
Spiderkeeper 2019(1)Installation and Introduction
2019-08-29 06:49 495Spiderkeeper 2019(1)Installatio ... -
Supervisor 2019(2)Ubuntu and Multiple Services
2019-08-19 10:53 366Supervisor 2019(2)Ubuntu and Mu ... -
Supervisor 2019(1)CentOS 7
2019-08-19 09:33 325Supervisor 2019(1)CentOS 7 Ins ... -
Redis Cluster 2019(3)Redis Cluster on CentOS
2019-08-17 04:07 367Redis Cluster 2019(3)Redis Clus ... -
Amazon Lambda and Version Limit
2019-08-02 01:42 433Amazon Lambda and Version Limit ... -
MySQL HA Solution 2019(1)Master Slave on MySQL 5.7
2019-07-27 22:26 514MySQL HA Solution 2019(1)Master ... -
RabbitMQ Cluster 2019(2)Cluster HA and Proxy
2019-07-11 12:41 456RabbitMQ Cluster 2019(2)Cluster ... -
Running Zeppelin with Nginx Authentication
2019-05-25 21:35 318Running Zeppelin with Nginx Aut ... -
Running Zeppelin with Nginx Authentication
2019-05-25 21:34 316Running Zeppelin with Nginx Aut ... -
ElasticSearch(3)Version Upgrade and Cluster
2019-05-20 05:00 322ElasticSearch(3)Version Upgrade ... -
Jetty Server and Cookie Domain Name
2019-04-28 23:59 396Jetty Server and Cookie Domain ...
相关推荐
麒麟v10内核版本为4.19.90-17.ky10.x86_64,这个内核版本应该能够支持RabbitMQ的运行。但在此之前,我们需要安装Erlang编程语言环境,因为RabbitMQ是用Erlang编写的。可以通过以下命令在麒麟v10上安装Erlang: ```...
新节点加入时,通常需要使用`rabbitmq-cluster join`命令来指定现有的集群节点,而移除节点则需要使用`rabbitmqctl`工具,这可能涉及数据迁移和状态更新。如果节点出现故障并需要重新加入集群,它必须先被正确地停止...
docker-rabbitmq-cluster集群搭建docker-rabbitmq-cluster集群搭建
k8s部署rabbitmq-cluster集群配置文件和docker镜像文件,配合文章学习用,有需要可以下载,无需修改直接部署即可
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.
ubuntu / trusty64 ubuntu / precise64 厨师/centos-6.5 主厨/debian-7.7属性钥匙类型描述默认['rabbitmq'] ['cluster'] 布尔型['rabbitmq'] ['cluster'] = true,并且需要['rabbitmq'] ['erlang_cookie']来配置...
rabbitMq window10安装包
rabbitmqctl join_cluster --ram rabbit@vm10-10-0-14 rabbitmqctl start_app ``` - **查看集群状态**:通过`rabbitmqctl cluster_status`命令来查看当前集群的状态。 ```bash rabbitmqctl cluster_status `...
RabbitMQ是一个强大的开源消息代理和队列服务器,它基于开放标准Advanced Message Queuing Protocol (AMQP)。这款工具主要用于在分布式系统中处理异步任务和消息传递,从而提高应用程序的可扩展性和可靠性。RabbitMQ...
使用ansible安装rabbitmq集群 需要预先实现控制节点的免密操作 参数说明 #rabbitmq rabbitmq安装目录 work_home: /data/test erlang_rpm安装文件名(放在files文件夹内) erlang_rpm: erlang-20.3.7-1.el7.centos....
《深入理解RabbitMQ 3.9.10:服务器详解与实战应用》 RabbitMQ,作为一款广泛应用的消息中间件,是企业级系统中实现异步处理、解耦架构和高并发场景的重要工具。本篇文章将围绕RabbitMQ 3.9.10这一版本,深入探讨其...
You’ll begin your journey with the installation and configuration of the RabbitMQ server, while also being given specific details pertaining to the subject. Next, you’ll study the major problems ...
在Windows 10上安装RabbitMQ,主要涉及以下步骤: 1. **下载RabbitMQ**: 首先,你需要从RabbitMQ官方网站(https://www.rabbitmq.com/)获取适用于Windows的RabbitMQ Server。这个“mq安装包”可能就是RabbitMQ的...
总结来说,"kubernetes-rabbitmq-cluster"项目提供了一个在Kubernetes中部署和管理RabbitMQ集群的有效方法,利用了Kubernetes的强大力量,实现了RabbitMQ服务的高可用性和可扩展性。通过学习和实践这个项目,开发者...
在IT行业中,RabbitMQ是一种广泛应用的消息队列服务器,它基于AMQP(Advanced Message Queuing Protocol)协议,用于处理应用程序之间的异步通信。在没有网络连接或者网络环境不稳定的情况下,离线安装RabbitMQ就...
rabbitmq配置文件,用于rabbitmq管理
《RabbitMQ 3.9.10源码安装详解》 RabbitMQ,作为一款广泛应用的消息中间件,被广泛用于构建分布式系统中的异步任务处理和数据交换。本文将详细解析RabbitMQ 3.9.10的源码安装过程,包括依赖的Erlang 24.1.7和...
在WIN10 中的RabbitMQ,版本为3.7。