Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build RabbitMq High availability Cluster Environment in CentOS

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to build a RabbitMq high-availability cluster environment in CentOS", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to build a RabbitMq high-availability cluster environment in CentOS".

The tutorials on building a highly available cluster environment in RabbitMq under CentOS are shared with you.

Preparatory work

1. Prepare two or more servers with rabbitmq-server services installed

I have prepared two here, one of which is as follows:

192.168.40.130 rabbitmq01

192.168.40.131 rabbitmq02

2. Make sure the firewall is off. 3. References on the official website

Http://www.rabbitmq.com/clustering.html

Hosts mapping

Modify the hosts file (path: / etc/hosts) on each service and set it as follows:

192.168.40.130 rabbitmq01

192.168.40.131 rabbitmq02

Modify Erlang Cookie

To build a cluster, you must modify the Erlang cookie of each cluster node to the same value.

For the CentOS,erlang.cookie file, under / root/.erlang.cookie.

Modify the Erlang cookie of rabbitmq01

Modify the Erlang cookie of rabbitmq02

Note: the permission of .erlang.cookie is 400 by default, so you need to change the permission to allow modification, and then restore it to 400. otherwise, you will report an error when starting rabbitmq-server.

The default permission is 400, as shown in the following figure.

Modify the permission to 660, as shown in the following figure.

After modification, restart the server!

Set up a cluster

1. Check the cluster status of each server first.

Use the command: rabbitmqctl cluster_status

Rabbitmq01:

There is currently only one node.

Rabbitmq02:

There is currently only one node.

2. Add (join) node

Now you want to put the rabbitmq02 join on the node rabbitmq01.

3. Check the cluster status of the server again

Use the command: rabbitmqctl cluster_status

Server rabbitmq01:

Server rabbitmq02:

These are all the contents of the article "how to build a RabbitMq High availability Cluster Environment in CentOS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report