preface

Install RabbitMQ using RPM. Install RabbitMQ using RPM. Install RabbitMQ using RPM.

The environment

Operating system CentOS 7 Socat 1.7.3.2 Erlang 23.1 RabbitMQ 3.8.9Copy the code

Note the version dependencies of Erlang and RabbitMQ, see dependencies.

Download and install

Download address

Socat	   http://repo.iotti.biz/CentOS/7/x86_64/
Erlang	   https://www.erlang-solutions.com/resources/download.html
RabbitMQ   https://github.com/rabbitmq/rabbitmq-server/releases
Copy the code

download

Create a rabbitmq directory under /usr/local/.

CD/usr/local/rabbitmq/wget wget HTTP: / / http://repo.iotti.biz/CentOS/7/x86_64/socat-1.7.3.2-5.el7.lux.x86_64.rpm https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_64/esl-erlang_23.1-1~centos~7_amd64.rpm wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.9/rabbitmq-server-3.8.9-1.el7.noarch.rpmCopy the code

The installation

The default directory for RabbitMQ installation is /var, and it is best to install RabbitMQ in your own directory. /var is the default directory for RabbitMQ installation.

RPM RPM -ivh socat-1.7.3.2-5.el7.lux.x86_64. RPM RPM -ivh esl-erlang_23.1-1 to centos to 7_amd64. RPM RPM -ivh The rabbitmq server - 3.8.9-1. El7. Noarch. RPMCopy the code

Error: Failed dependencies: libnsl.so.1()(64bit) is needed by erlang-22.3.4.11-1.el6.x86_64

dnf install libnsl
Copy the code

Basic operation

Some basic operations on RabbitMQ

$sudo rabbitmq-server on $sudo rabbitmq-server start $sudo rabbitmq-server -detached # start background $sudo rabbitmq-server status $sudo rabbitmq-server stop $sudo rabbitmqctl $sudo rabbitmqctl list_user_permissions guest $sudo rabbitmqctl list_user_permissions guest To be on the safe side, $sudo rabbitmqctl add_user username password $sudo rabbitmqctl add_user username password $sudo Rabbitmqctl set_user_tags username administrator $sudo rabbitmqctl set_permissions -p/username $sudo rabbitmqctl list_user_permissions username ".*" ".*Copy the code

Modify the configuration

The default installation path for RabbitMQ is /var

If you want to store data and logs separately, create mnesia and logs under /usr/local/rabbitmq/to store data and logs respectively.

Permission to modify

chmod -R 777 /usr/local/rabbitmq
chown -R rabbitmq:rabbitmq  /usr/local/rabbitmq/mnesia
chown -R rabbitmq:rabbitmq  /usr/local/rabbitmq/logs
Copy the code

Writing configuration files

vim /etc/rabbitmq/rabbitmq-env.conf
Copy the code

Add the following two lines

RABBITMQ_MNESIA_BASE=/usr/local/rabbitmq/mnesia
RABBITMQ_LOG_BASE=/usr/local/rabbitmq/log
Copy the code

You want remote URL access

rabbitmq-plugins enable rabbitmq_management
Copy the code

The default port is 15672. You want to change this port

vim /etc/rabbitmq/rabbitmq.conf
Copy the code

Add the following

management.tcp.port = 15673
Copy the code

Save the Settings and restart the RabbitMQ service

Configuration file details

The three configuration files for Rabbitmq are located in /etc/rabbitmq/ :

1.enabled_plugins

Set the list of allowed plugins in the format of Erlang's list such as [rabbitMQ_management, rabbitMQ_Visualiser]. Look not to understand ~ ~ ~Copy the code

2.rabbitmq.conf

Set the rabbitMQ running parameters. Example: https://github.com/rabbitmq/rabbitmq-server/blob/master/docs/rabbitmq.conf.exampleCopy the code

3.rabbitmq-env.conf

RABBITMQ_NODE_PORT Port Settings. The default value is 5672. RABBITMQ_NODENAME Node name, the default value is Rabbit RABBITMQ_MNESIA_BASE back-end storage directory. The default value is /var/lib/rabbitmq/mnesia RABBITMQ_LOG_BASE log directory. The default value is /var/log/rabbitmq/Copy the code

conclusion

Heart tired…