权限不足
chmod 775 /opt/homebrew/var/lib/rabbitmq
创建虚拟主机:执行以下命令以创建一个新的虚拟主
rabbitmqctl add_vhost <vhost_name>
授予访问权限:为新创建的虚拟主机授予访问权限。执行以下命令以将默认用户(guest)授予对虚拟主机的读写权限:
rabbitmqctl set_permissions -p <vhost_name> guest ".*" ".*" ".*"
验证虚拟主机创建:执行以下命令以验证虚拟主机是否成功创建:
rabbitmqctl list_vhosts
关闭
brew services stop rabbitmq
启动
brew services start rabbitmq
添加用户
rabbitmqctl add_user <username> <password>
分配管理员
rabbitmqctl set_user_tags <username> administrator
设置权限
rabbitmqctl set_permissions -p / <username> ".*" ".*" ".*"