Background of 0.

This article describes how to install RabbitMQ.

1. Prepare

Before installing RabbitMQ, install the following dependencies.

  • Erlang: Since RabbitMQ is developed in Erlang, it needs to be installed to run.
  • Socat: A versatile networking tool named after “SocketCAT”.
  • Logrotate: a log file management tool.

(1) install Erlang refer to my another article: www.jianshu.com/p/3bae58df9…

(2) install socat

  yum install  socat
Copy the code

(3) installation logrotate

  yum install  logrotate
Copy the code

2. Install the RabbitMQ

Install RabbitMQ to install RabbitMQ server software RabbitMq-server. The client is generally connected through the framework of each programming software (class library package).

Here I use download NPM and then install the way.

Get the NPM and install it

  • Download the Server from the official website and refer to section [Download the Server] in the Installation guide.
  • Yum install -y yum install -y
Yum wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.3/rabbitmq-server-3.8.3-1.el7.noarch.rpm Install -- y the rabbitmq server - 3.8.3-1. El7. Noarch. RPMCopy the code

3. Start the RabbitMQ server

Chkconfig When installing the RabbitMQ server software package, the server is not started as a daemon by default. Daemon is started by default during system boot and runs as an administrator. Execute the following command:

chkconfig rabbitmq-server on
Copy the code

Start and stop operations

service rabbitmq-server start
service rabbitmq-server stop
Copy the code

View the running status of the service

systemctl status rabbitmq-server.service
Copy the code

You can also check whether lsof is running by viewing the port number.

lsof -i:5672 
Copy the code

The rabbitmqctl command rabbitmqctl is the tool for managing RabbitMQ. You can use it to check the status of RabbitMQ.

Rabbitmqctl status rabbitmqctl statusCopy the code

Other configuration reference website: www.rabbitmq.com/configure.h…

4. Manage RabbitMQ using the Web UI

RabbitMQ provides a very convenient Web management system. The RabbitMQ Management plugin provides a Management UI and HTTP API for RabbitMQ.

This plug-in is included with the RabbitMQ distribution and must be enabled before it can be used.

Enable the rabbitmq_management plugin

rabbitmq-plugins enable rabbitmq_management
Copy the code

Then you can log in

Login using the URL:

 http://{node-hostname}:15672/.
Copy the code

image.png

There is a guest user by default, but you can only log on to the machine as my RabbitMQ is installed in the virtual machine and I can only create a new user to log on remotely.

Create an account in the Web management system

rabbitmqctl add_user admin admin
Copy the code

I created a user name: admin, password: admin

Grant super administrator privileges to the newly created account

rabbitmqctl set_user_tags admin administrator
Copy the code

To complete.

4. Reference

www.rabbitmq.com/install-rpm…

weifabiao.com/server/528/

Management tool: www.rabbitmq.com/management…. Plug-in management: www.rabbitmq.com/plugins.htm…

Instruction: www.rabbitmq.com/man/rabbitm…