前提:已经安装好了rabbitmq了,我这里是最新的版本 3.8.16
Erlang 安装的是24
注:3.7.15版本以上要求安装的是23.2以上版本才可以。
cd /usr/local/software/rabbitmq_software/rabbitmq_server-3.8.16/sbin
[root@localhost sbin]#
[root@localhost sbin]#
[root@localhost sbin]# ./rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@localhost:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@localhost...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
set 3 plugins.
Offline change; changes will take effect at broker restart.
[root@localhost sbin]# ./rabbitmq-server -detached
[root@localhost sbin]# ./rabbitmqctl add_user admin admin
Adding user "admin" ...
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
[root@localhost sbin]#
[root@localhost sbin]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
[root@localhost sbin]# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
Setting permissions for user "admin" in vhost "/" ...
[root@localhost sbin]#
RabbitMQ的Username 和 Password 默认为guest/guest
可以看到Login failed (登录失败),User can only log in via localhost (用户只能通过本地主机登录),因为rabbitmq从3.3.0开始禁止使用guest/guest管理员权限通过除localhost外的访问
如果想解决:
添加远程用户名:./rabbitmqctl add_user admin admin
Adding user "admin" ...
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
[root@localhost sbin]#
[root@localhost sbin]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
[root@localhost sbin]# rabbitmqctl set_permissions -p / admin “." ".” “.*”
Setting permissions for user "admin" in vhost "/" ...
[root@localhost sbin]#
即可 账户密码为 admin admin
其他步骤安装请参考:https://blog.csdn.net/SuperChen12356/article/details/117113498
http://10.4.0.43:15672/