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
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
3.2) Stop service
service rabbitmq-server stop
3.3) Set boot up
chkconfig rabbitmq-server on
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" ...
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] ...
[ 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 "/" ...
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" ...
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