启动:
rabbitmq-server -detached
停止:
rabbitmqctl stop
状态:
rabbitmqctl status
查看所有用户
rabbitmqctl list_users
添加一个用户
rabbitmqctl add_user zhaobl 123456
配置权限
rabbitmqctl set_permissions -p "/" zhaobl ".*" ".*" ".*"
查看用户权限
rabbitmqctl list_user_permissions zhaobl
设置tag
rabbitmqctl set_user_tags zhaobl administrator
删除用户(安全起见,删除默认用户)
rabbitmqctl delete_user guest
加用户
rabbitmqctl add_user frj 123456
配用户权限
rabbitmqctl set_permissions -p "/" frj ".*" ".*" ".*"
查看用户权限
rabbitmqctl list_user_permissions frj
RabbitMQ Not management user
rabbitmqctl set_user_tags frj administrator
关闭防火墙
[root@localhost erlang]# firewall-cmd --state
running
[root@localhost erlang]# systemctl stop firewalld.service
[root@localhost erlang]# firewall-cmd --state
not running
[root@localhost erlang]#
# 添加 vhost
rabbitmqctl add_vhost /myhost
access to vhost '/myhost' refused for user 'frj',
rabbitmqctl set_permissions -p /myhost frj '.*' '.*' '.*'
配置rabbitmq环境变量,vi /etc/profile文件
增加配置:
ERL_HOME=/opt/erlang
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
export PATH=$PATH: /opt/ rabbitmq_server-3.7.12/sbin
source /etc/profile使得文件生效