在ubuntu16上搭建rabbitMQ环境

时间:2023-03-08 18:05:16
在ubuntu16上搭建rabbitMQ环境

在ubuntu16上搭建rabbitMQ环境

安装rabbitMQ

apt-cache pkgnames | grep rabbitmq
apt-get install rabbitmq-server

使web管理插件生效

rabbitmq-plugins enable rabbitmq_management

查看端口号

root@ubuntu:~# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 3092/beam
tcp6 0 0 :::5672 :::* LISTEN 3092/beam

创建账户

rabbitmqctl add_user admin admin
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

使用浏览器访问

http://youip:15672/

rabbitmqctl 命令行操作

用户相关

add_user <username> <password>
delete_user <username>
change_password <username> <newpassword>
clear_password <username>
authenticate_user <username> <password>
set_user_tags <username> <tag> ...
list_users
set_permissions [-p <vhostpath>] <user> <conf> <write> <read>
clear_permissions [-p <vhostpath>] <username>
list_user_permissions <username>

权限相关

set_permissions [-p <vhostpath>] <user> <conf> <write> <read>
clear_permissions [-p <vhostpath>] <username>
list_permissions [-p <vhostpath>]
list_user_permissions <username>

虚拟环境相关命令

add_vhost <vhostpath>
delete_vhost <vhostpath>
list_vhosts [<vhostinfoitem> ...]

状态信息查看相关

list_users
list_vhosts [<vhostinfoitem> ...]
list_permissions [-p <vhostpath>]
list_user_permissions <username>
list_parameters [-p <vhostpath>]
list_policies [-p <vhostpath>]
list_queues [-p <vhostpath>] [<queueinfoitem> ...]
list_exchanges [-p <vhostpath>] [<exchangeinfoitem> ...]
list_bindings [-p <vhostpath>] [<bindinginfoitem> ...]
list_connections [<connectioninfoitem> ...]
list_channels [<channelinfoitem> ...]
list_consumers [-p <vhostpath>]

列出服务状态报告

report