install RabbitMQ on centos

  1. Install Erlang environment (RabbitMQ is developed by Erlang language)
    1.1) Download the rpm installation package
    Official address: https://packages.erlang-solutions.com/erlang/
    wget http://packages.erlang-solutions.com/site/esl/esl-erlang/FLAVOUR_1_general/esl-erlang_21.1.4-1~centos~6_amd64.rpm

1.2) Install Erlang
rpm -ivh esl-erlang_21.1.4-1~centos~6_amd64.rpm
or
1.1) Install the Erlang Solutions repository to your system (the purpose is to allow you to use yum to install the latest version of erlang, if not set, the erlang version installed by yum is usually too low)
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
 1.2)yum install -y erlang
Because rabbitmq is implemented in erlang language, erlang dependencies need to be installed;
The RabbitMQ provided here is the latest version 3.6.9, and the required erlang version is at least R16B-03, otherwise the compilation will fail
1.3) Check whether Erlang is installed successfully
[ root@localhost ~]# erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 10.1.3

  1. Install RabbitMQ
    2.1) Download the rpm installation package
    Official address: http://www.rabbitmq.com/download.html
    wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.15/rabbitmq-server-3.6.15-1.el6.noarch.rpm

2.2) Install RabbitMQ
yum -y install epel-release
Then execute yum -y install socat
yum install -y rabbitmq-server-3.6.15-1.el6.noarch.rpm

2.3) Check if RabbitMQ is installed successfully
rabbitmqctl status

  1. About service
    3.1) Start the service
    service rabbitmq-server start

3.2) Stop service
service rabbitmq-server stop

3.3) Set boot up
chkconfig rabbitmq-server on

  1. User Management
    4.1) View user list
    [ root@localhost ~]# rabbitmqctl list_users
    Listing users ...
    guest   [administrator]

4.2) Add user
rabbitmqctl add_user username password

[ root@localhost ~]# rabbitmqctl add_user admin 123456
Adding user "admin" ...

4.3) Delete user
rabbitmqctl delete_user username

[ root@localhost ~]# rabbitmqctl delete_user admin
Deleting user "admin" ...

4.4) Modify user password
rabbitmqctl change_password username new password

[ root@localhost ~]# rabbitmqctl change_password admin 666666
Changing password for user "admin" ...

  1. Role management
    5.1) Role description
    none (normal user)
    No console operation authority.

management (ordinary administrator)
You can view the queues, exchanges and bindings of the current user.
You can view and close the current user's channels and connections.
You can view the statistics of the current user's virtual hosts.

policymaker (policy manager)
Have management permissions and view, create and delete the current user's policies and parameters.

monitoring (monitoring administrator)
Have management permissions
View all virtual hosts and global statistics
View connections and channels of all users
View all node data, such as clustering and memory usage

administrator (super administrator)
Have policymaker, monitoring permissions
View, create, delete all virtual hosts
View, create, delete all users
View, create, delete all permissions
Can close all users' connections

5.2) View user roles
rabbitmqctl list_users username
[ root@localhost ~]# rabbitmqctl list_users
Listing users ...
admin   [administrator]
guest   [administrator]

5.3) Set user roles
rabbitmqctl set_user_tags admin role name (supports simultaneous setting of multiple roles)

[ root@localhost ~]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...

  1. authority management
    User authority refers to the user's operation authority to exchange and queue, including configuration authority, read and write authority. The configuration permissions will affect the declaration and deletion of exchange and queue. Read and write permissions will affect queue read and write messages, exchange send messages, and the binding operation of queue and exchange.
    6.1) View user permissions
    rabbitmqctl list_user_permissions username

[ root@localhost ~]# rabbitmqctl list_user_permissions guest
Listing permissions for user "guest" ...
/       .*      .*      .*

6.2) Set user permissions
rabbitmqctl set_permissions -p virtual host name username

[ root@localhost ~]# rabbitmqctl set_permissions -p / admin '.' '.' '.*'
Setting permissions for user "admin" in vhost "/" ...

  1. Virtual host management
    Why do I need a virtual host (vhost)? Because RabbitMQ can only control permissions at the granularity of the virtual host. Each vhost is essentially a mini version of RabbitMQ server, with its own queues, switches, and bindings.
    7.1) View virtual host
    [ root@localhost ~]# rabbitmqctl list_vhosts
    Listing vhosts ...
    /

7.2) Add virtual host
rabbitmqctl add_vhost virtual host name

[ root@localhost ~]# rabbitmqctl add_vhost coreSystem
Adding vhost "coreSystem" ...

7.3) Delete virtual host
rabbitmqctl delete_vhost virtual host name

[ root@localhost ~]# rabbitmqctl delete_vhost coreSystem
Deleting vhost "coreSystem" ...

  1. web background management
    8.1) Enable background management plugin

rabbitmq-plugins enable rabbitmq_management

8.2 )log in
Browser input: http://serverIp:15672/

Stop firewall
systemctl stop firewalld.service
Allow through firewall
firewall-cmd --zone=public --add-port=15672/tcp --permanent
rabbitmq port
4369 ( epmd), 25672 (Erlang distribution)
5672, 5671 ( AMQP 0-9-1 without and with TLS)
15672 ( if management plugin is enabled)
61613, 61614 ( if STOMP is enabled)
1883, 8883 ( if MQTT is enabled)

Recommended Posts

Install RabbitMQ on CentOS 7
install RabbitMQ on centos
Install RabbitMQ on CentOS 7
Install RabbitMQ on CentOS7
centOs install rabbitMQ
Install Docker on Centos7
install LNMP on centos7.4
Nodejs install on centos7
Install FFmpeg on CentOS 8
Install Node.js on Centos
Maven install on centos7
Install MongoDB on CentOS 7
Install Surelog on CentOS8
Openjdk install on centos7
Install Jenkins on centos7
install Docker on centos6.5
install oracle on centos
Install Elasticsearch 6 on centos7
Install mysql online on centos
Install ElasticSearch 7.x on CentOS 7
CentOS7 install rabbitmq cluster (binary)
Install MySQL 8.0.16 on Linux Centos
Install docker transfer on Centos7
Install docker on Centos system
install EPEL repo on centos
1.5 Install Centos7
Install Zabbix 3.4 based on CentOS 7
install virtualbox on centos server
Install Nginx server on CentOS 7
How to install MySQL on CentOS 8
Install JDK8 in rpm on CentOS7
How to install Memcached on CentOS 8
Install MATE or XFCE on CentOS 7
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
Install MySQL on Linux CentOS7 (Windows)
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
​Install Oracle database on CentOS Linux
How to install Python on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8