Please state the source of the article. Welcome to add Echo wechat (wechat id: T2421499075) for exchange and learning.


Installing RabbitMQ on Linux requires the installation of its runtime environment ‘Erlang’, which I used in this case CentOS7

Install Erlang

  • To prepare, install wGET
yum install -y wget
Copy the code
  • Install dependencies
yum install -y epel-release
Copy the code
  • Configuring the Installation Source
Wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm RPM -uvh erlang-solutions-1.0-1.noarch. RPMCopy the code
  • The installation
yum install -y erlang
Copy the code
  • Verify that the installation is successful
erl -version
Copy the code

If the following information is displayed, it proves successful

Install the RabbitMQ

  • Configuring the Installation Source
The RPM wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.9/rabbitmq-server-3.7.9-1.el7.noarch.rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.ascCopy the code
  • The installation
Yum install the rabbitmq server - 3.7.9-1. El7. Noarch. RPMCopy the code
  • After the installation is complete, we can start up
sudo /sbin/service rabbitmq-server start
Copy the code
  • Check the status after startup
sudo /sbin/service rabbitmq-server status
Copy the code

If you read this, you have succeeded

Installation Management Page

  • Installing the Web Plug-in
sudo rabbitmq-plugins enable rabbitmq_management
Copy the code
  • Open ports
/sbin/iptables -I INPUT -p tcp --dport 5672 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 15672 -j ACCEPT
Copy the code

Note: access is not available at this time, since remote access is not available, we need to open remote access

  • Find the corresponding configuration file
Vi/usr/lib/rabbitmq/lib/rabbitmq_server - 3.7.9 ebin/rabbit. The app # will loopback_users corresponding values, instead of []Copy the code

  • Then we can access it.

  • Basic operation commands for RabbitMQ
Sudo chkconfig rabbitmq-server on sudo /sbin/service rabbitmq-server start sudo /sbin/service rabbitmq-server Sudo /sbin/service rabbitmq-server stop rabbitmqctl list_users Sudo rabbitmqctl list_user_permissions guest; sudo rabbitmqctl list_user_permissions guest To be on the safe side, Add new user sudo rabbitmqctl add_user username password sudo rabbitmqctl add_user username password Rabbitmqctl set_user_tags username administrator sudo rabbitmqctl set_permissions -p/username Sudo rabbitmqctl list_user_permissions username ".*" ".*Copy the code