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
- 浏览: 2503572 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
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 1625I am still keep notes my tech n ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 263Hadoop Docker 2019 Version 3.2. ... -
Nginx and Proxy 2019(1)Nginx Enable Lua and Parse JSON
2019-12-03 04:17 394Nginx and Proxy 2019(1)Nginx En ... -
Data Solution 2019(13)Docker Zeppelin Notebook and Memory Configuration
2019-11-09 07:15 257Data Solution 2019(13)Docker Ze ... -
Data Solution 2019(10)Spark Cluster Solution with Zeppelin
2019-10-29 08:37 220Data Solution 2019(10)Spark Clu ... -
AMAZON Kinesis Firehose 2019(1)Firehose Buffer to S3
2019-10-01 10:15 296AMAZON Kinesis Firehose 2019(1) ... -
Rancher and k8s 2019(3)Clean Installation on CentOS7
2019-09-19 23:25 276Rancher and k8s 2019(3)Clean In ... -
Pacemaker 2019(1)Introduction and Installation on CentOS7
2019-09-11 05:48 311Pacemaker 2019(1)Introduction a ... -
Crontab-UI installation and Introduction
2019-08-30 05:54 421Crontab-UI installation and Int ... -
Spiderkeeper 2019(1)Installation and Introduction
2019-08-29 06:49 469Spiderkeeper 2019(1)Installatio ... -
Supervisor 2019(2)Ubuntu and Multiple Services
2019-08-19 10:53 336Supervisor 2019(2)Ubuntu and Mu ... -
Supervisor 2019(1)CentOS 7
2019-08-19 09:33 294Supervisor 2019(1)CentOS 7 Ins ... -
Redis Cluster 2019(3)Redis Cluster on CentOS
2019-08-17 04:07 347Redis Cluster 2019(3)Redis Clus ... -
Amazon Lambda and Version Limit
2019-08-02 01:42 399Amazon Lambda and Version Limit ... -
MySQL HA Solution 2019(1)Master Slave on MySQL 5.7
2019-07-27 22:26 431MySQL HA Solution 2019(1)Master ... -
RabbitMQ Cluster 2019(2)Cluster HA and Proxy
2019-07-11 12:41 437RabbitMQ Cluster 2019(2)Cluster ... -
Running Zeppelin with Nginx Authentication
2019-05-25 21:35 300Running Zeppelin with Nginx Aut ... -
Running Zeppelin with Nginx Authentication
2019-05-25 21:34 305Running Zeppelin with Nginx Aut ... -
ElasticSearch(3)Version Upgrade and Cluster
2019-05-20 05:00 307ElasticSearch(3)Version Upgrade ... -
Jetty Server and Cookie Domain Name
2019-04-28 23:59 373Jetty Server and Cookie Domain ...
相关推荐
rabbitMq window10安装包
docker-rabbitmq-cluster集群搭建docker-rabbitmq-cluster集群搭建
k8s部署rabbitmq-cluster集群配置文件和docker镜像文件,配合文章学习用,有需要可以下载,无需修改直接部署即可
麒麟v10操作系统 内核版本4.19.90-17.ky10.x86_64 rabbitmq3.6.10
distributed messaging for everyone
翻译的RabbitMQ官网上,关于集群部分的文档。自己留存,也希望对别人有用。
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 Cluster docker 镜像制作
使用ansible安装rabbitmq集群 需要预先实现控制节点的免密操作 参数说明 #rabbitmq rabbitmq安装目录 work_home: /data/test erlang_rpm安装文件名(放在files文件夹内) erlang_rpm: erlang-20.3.7-1.el7.centos....
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 ...
RabbitMQ 是一个由 Erlang 语言开发的 AMQP 的开源实现,此附件包含RabbitMq相关安装包及超详细安装教程,可完美解决RabbitMq安装与配置问题
RabbitMQ资料RabbitMQ资料RabbitMQ资料RabbitMQ资料
rabbitmq配置文件,用于rabbitmq管理
本人rabbitmq集群环境搭建笔记分享。
在WIN10 中的RabbitMQ,版本为3.7。
Scale the RabbitMQ server using the clusters and high availability techniques Extend RabbitMQ by developing the Erlang OTP-based applications that use the RabbitMQ API Manage the RabbitMQ server using...
win10安装rabbitmq的安装包.rar
rabbitmq 源码安装包
tp6使用rabbitmq