Linux RabbitMQ cluster construction process diagram

Linux RabbitMQ cluster construction process diagram

1. Overall steps

At the beginning, we introduced how to install and run RabbitMQ services, but these are stand-alone versions and cannot meet the requirements of current real applications. What should I do if the RabbitMQ server encounters a memory crash, a machine power outage, or a motherboard failure? A single RabbitMQ server can meet the throughput of 1,000 messages per second. What if the application requires the RabbitMQ service to meet the throughput of 100,000 messages per second? Purchasing expensive servers to enhance the performance of a single-machine RabbitMQ service is not enough. Building a RabbitMQ cluster is the key to solving practical problems.

First, we need 3 Linux operating systems. Here I have cloned them completely. You can see it based on your situation.

Then modify the host names of the three Linux operating systems

vim /etc/hostname

After making the changes here, it is recommended to restart them all (reboot).

After restarting, configure the hosts file of each node so that each node can recognize each other.

vim /etc/hosts

Next, to ensure that the cookie files of each node use the same value, execute the remote operation command on node1.

scp /var/lib/rabbitmq/.erlang.cookie root@node2:/var/lib/rabbitmq/.erlang.cookie
scp /var/lib/rabbitmq/.erlang.cookie root@node3:/var/lib/rabbitmq/.erlang.cookie

Start the RabbitMQ service, and also start the Erlang virtual machine and the RbbitMQ application service (execute the following commands on each of the three nodes)

rabbitmq-server-detached

The next thing to do is to add node node3 to node1 and node node2 to node3. (You can also add node3 to node1, and node2 to node1, it's the same)

One thing to note here is: turn off the firewall! ! !

After the node is added, we can check the cluster status

rabbitmqctl cluster_status

Next, we need RabbitMQ account information. Just add it, set the username, password, and grant all permissions.

Create Account
rabbitmqctl add_user admin 123
Setting User Roles
rabbitmqctl set_user_tags admin administrator
Setting User Permissions
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"

At this point, the cluster setup is complete. Finally, you can access the RabbitMQ backend web management console in the browser. You can see that the cluster information is fully presented! ! !

The above is the detailed content of the RabbitMQ cluster construction process diagram. For more information about RabbitMQ cluster construction, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Detailed tutorial on installing RabbitMQ on Linux
  • Solve the problem of not being able to access the RabbitMQ management page in the Linux server

<<:  Solution to input cursor misalignment in Chrome, Firefox, and IE

>>:  Detailed explanation of Vue px to rem configuration

Recommend

Analysis of the use of the MySQL database show processlist command

In actual project development, if we have a lot o...

Manual and scheduled backup steps for MySQL database

Table of contents Manual backup Timer backup Manu...

Detailed explanation of vue page state persistence

Table of contents Code: Replenish: Summarize Requ...

How to completely delete and uninstall MySQL in Windows 10

Preface This article introduces a tutorial on how...

Detailed explanation of JavaScript to monitor route changes

Table of contents history pushState() Method push...

Solve the Linux Tensorflow2.0 installation problem

conda update conda pip install tf-nightly-gpu-2.0...

Introduction to Sublime Text 2, a web front-end tool

Sublime Text 2 is a lightweight, simple, efficien...

Implementing a simple calculator based on JavaScript

This article shares the specific code of JavaScri...

my.cnf (my.ini) important parameter optimization configuration instructions

MyISAM storage engine The MyISAM storage engine i...

Vue uses mixins to optimize components

Table of contents Mixins implementation Hook func...

Detailed explanation of how to gracefully delete a large table in MySQL

Preface To delete a table, the command that comes...

Nginx configuration to achieve multiple server load balancing

Nginx load balancing server: IP: 192.168.0.4 (Ngi...

Steps to create a Vite project

Table of contents Preface What does yarn create d...