Set up the high-availability cluster environment of RabbitMq in CentOS, and set up centosrabbitmq

Source: Internet
Author: User

Set up the high-availability cluster environment of RabbitMq in CentOS, and set up centosrabbitmq
Preparations 1: Prepare two or more servers with the rabbitmq-server service installed.

I have prepared the following two servers:

192.168.40.130 rabbitmq01
192.168.40.131 rabbitmq02

2. Make sure that the firewall is disabled. 3. Official website references

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

Hosts ing

Modify the hosts file (Path:/etc/hosts) on each service and set it to the following:

192.168.40.130 rabbitmq01
192.168.40.131 rabbitmq02

Modify Erlang Cookie

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

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

Modify the Erlang cookie of rabbitmq01

 

Modify the Erlang cookie of rabbitmq02

 

Note: The default value is. erlang. the cookie permission is 400. Therefore, you must first change the permission to allow modification, and then restore the permission to 400. Otherwise, an error will be reported when rabbitmq-server is started.

The default permission is 400, for example.

 

Change the permission to 660, as shown in.

After modification, restart the server!

Set up cluster 1. First, check the cluster status of each server.

Command: rabbitmqctl cluster_status

 

Rabbitmq01:

Currently, there is only one node.

 

Rabbitmq02:

Currently, there is only one node.

 

2. Add (join) nodes

Join rabbitmq02 to the node rabbitmq01.

 

3. Check the cluster status of the server again.

Command: rabbitmqctl cluster_status

 

Server rabbitmq01:

 

Server rabbitmq02:

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.