PS:RabbitMQ is an open source message broker software that implements the Advanced Message Queue Protocol (AMQP). It is used to store and forward messages in distributed systems. It has good usability, scalability and high availability. This article describes how to deploy RabbitMQ from a server instance

1. Install dependent environment Erlang

RabbitMQ relies on Erlang and is installed through the package manager

Making address: github.com/rabbitmq/er…

# Add Erlang Solutions source wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm RPM -uvh Erlang solutions-1.0-1.noarch. RPM # install Erlang yum install -y Erlang # install erl-versionCopy the code

2. Install soCAT

yum -y install socat
Copy the code

3. Install RabbitMQ

Making address: github.com/rabbitmq/ra…

Download rabbitmq RPM wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.16/rabbitmq-server-3.8.16-1.el8.noarch.rpm RPM - the ivh The rabbitmq server - 3.8.17. Rc. 1-1. El7. Noarch. RPMCopy the code

4. Install the Web interface plug-in

rabbitmq-plugins enable rabbitmq_management  
Copy the code

5. Start RabbitMQ

systemctl start rabbitmq-server
Copy the code

6. Create a RabbitMQ user

# add user "root"; Password: "root" rabbitmqctl add_user root root # Set user to administrator rabbitmqctl set_user_tags root administrator # Authorize remote access to Rabbitmqctl set_permissions -p / root "." "." ".*"Copy the code

7. Browser accesshttp://ip address: 15672

Common Service Commands

# Set boot-up: Systemctl enable rabbitmq-server systemctl start rabbitmq-server systemctl restart rabbitmq-server Systemctl stop rabbitmq-server systemctl status rabbitmq-serverCopy the code

User Roles

By default, both username and password for accessing RabbitMQ services are “guest”. This account is restricted,

By default, access is restricted to the local network (such as localhost).

Error: User can only log in via localhost: User can only log in via localhost.

This is because by default the guest user can only log in to localhost:15672. So before you can implement production and consumption messages, you need to add another user and set the corresponding access rights

1. The super administrator can log in to the management console, view all information, and operate users and policies. Monitoring allows users to view rabbitMQ node information (process count, memory usage, disk usage, etc.). Policymaker allows users to log in to the Management console and manage policies. However, you cannot view the node information (marked by the red box in the figure above). Common managers can only log in to the management console. They cannot see node information or manage policies. Others who cannot log on to the management console are usually ordinary producers and consumers.Copy the code