RabbitMQ安装与基本管理

2019-10-01  本文已影响0人  王小板爱吃鱼

安装

vim /etc/yum.repos.d/rabbitmq-erlang.repo
# In /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/22/el/7
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
yum install erlang
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.18/rabbitmq-server-3.7.18-1.el7.noarch.rpm
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc

为了使用Yum存储库,必须在/etc/yum.repos.d/目录下添加一个.repo文件(例如,rabbitmq.repo)不同的发行版内容有所不同,以下针对centos7。

[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/7/
gpgcheck=0
repo_gpgcheck=0
enabled=1
yum clean all
yum makecache
yum install rabbitmq-server-3.7.18-1.el7.noarch.rpm

服务管理


service rabbitmq-server start

service rabbitmq-server stop

service rabbitmq-server status

service rabbitmq-server restart


rabbitmq-plugins enable rabbitmq_management

service rabbitmq-server restart

用户管理


rabbitmqctl add_user admin 123456


rabbitmqctl set_user_tags admin administrator


rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"


rabbitmqctl list_permissions -p /

其他用户管理


add_user <username> <password>


delete_user <username>


change_password <username> <newpassword>


clear_password <username>


set_user_tags <username> <tag> ...


list_users


add_vhost <vhostpath>


delete_vhost <vhostpath> 


list_vhosts [<vhostinfoitem> ...]


set_permissions [-p <vhostpath>] <user> <conf> <write> <read>


clear_permissions [-p <vhostpath>] <username> 


list_permissions [-p <vhostpath>] 


list_user_permissions <username> 

set_parameter [-p <vhostpath>] <component_name> <name> <value>

clear_parameter [-p <vhostpath>] <component_name> <key>

list_parameters [-p <vhostpath>]

上一篇下一篇

猜你喜欢

热点阅读