Yum online installation, simple, fast, and automatic installation of dependent packages.
1. Install Erlang environment (RabbitMQ is developed by Erlang language)
1.1) Download the rpm installation package
Official address: http://www.erlang.org/downloads
wget -O erlang-20.3.4-1.el7.centos.x86_64.rpm https://bintray.com/rabbitmq/rpm/download_file?file_path=erlang%2F20%2Fel%2F7%2Fx86_64%2Ferlang-20.3.4-1.el7.centos.x86_64.rpm
1.2) Install Erlang
yum install -y erlang-20.3.4-1.el7.centos.x86_64.rpm
1.3) Check whether Erlang is installed successfully
[ root@localhost ~]# erl -version
Erlang(SMP,ASYNC_THREADS,HIPE)(BEAM) emulator version 9.3[root@localhost ~]#
2. Install RabbitMQ
2.1 ) Download the rpm installation package
Official address: http://www.rabbitmq.com/download.html
wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.4/rabbitmq-server-3.7.4-1.el7.noarch.rpm
2.2) Install RabbitMQ
yum install -y rabbitmq-server-3.7.4-1.el7.noarch.rpm
2.3) Check if RabbitMQ is installed successfully
[ root@localhost ~]# rabbitmqctl status
Status of node rabbit@localhost ...[{pid,14618},{running_applications,[{rabbitmq_management,"RabbitMQ Management Console","3.7.4"},{rabbitmq_management_agent,"RabbitMQ Management Agent","3.7.4"},{amqp_client,"RabbitMQ AMQP Client","3.7.4"},{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.7.4"},{cowboy,"Small, fast, modern HTTP server.","2.2.2"},{cowlib,"Support library for manipulating Web protocols.","2.1.0"},{rabbit,"RabbitMQ","3.7.4"},{rabbit_common,"Modules shared by rabbitmq-server and rabbitmq-erlang-client","3.7.4"},...
3. 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
4. User Management
4.1) View user list
[ root@localhost ~]# rabbitmqctl list_users
Listing users ...
guest [administrator][root@localhost ~]#
4.2) Add user
rabbitmqctl add_user username password
[ root@localhost ~]# rabbitmqctl add_user admin 123456
Adding user "admin"...[root@localhost ~]#
4.3) Delete user
rabbitmqctl delete_user username
[ root@localhost ~]# rabbitmqctl delete_user admin
Deleting user "admin"...[root@localhost ~]#
4.4) Modify user password
rabbitmqctl change_password username new password
[ root@localhost ~]# rabbitmqctl change_password admin 666666
Changing password for user "admin"...[root@localhost ~]#
5. Role management
5.1) Role description
none (normal user)
No console operation authority.
management (ordinary administrator)
You can view the queues of the current user,exchanges and bindings.
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][root@localhost ~]#
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]...[root@localhost ~]#
6. 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".../.*.*.*[root@localhost ~]#
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 "/"...[root@localhost ~]#
7. 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 .../[root@localhost ~]#
7.2) Add virtual host
rabbitmqctl add_vhost virtual host name
[ root@localhost ~]# rabbitmqctl add_vhost coreSystem
Adding vhost "coreSystem"...[root@localhost ~]#
7.3) Delete virtual host
rabbitmqctl delete_vhost virtual host name
[ root@localhost ~]# rabbitmqctl delete_vhost coreSystem
Deleting vhost "coreSystem"...[root@localhost ~]#
8. web background management
8.1) Enable background management plugin
[ root@localhost ~]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@localhost...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
started 3 plugins.[root@localhost ~]#
8.2) Login
Browser input: http://serverIp:15672/
Recommended Posts