新安装的单机rabbitmq版本3.6.6.
1)guest用户无法web登录。
2)后端程序提示 rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
3)rabbitmq日志提示
=ERROR REPORT==== 2-Feb-2021::10:23:09 ===
Error on AMQP connection <0.2697.0> (192.168.7.192:40568 -> 192.168.7.195:5672, state: starting):
PLAIN login refused: user 'guest' can only connect via localhost
原因:
rabbitmq从3.3版本以后,禁止guest用户远程访问。
解决方法:
1.找到rabbit.app这个文件,我是yum安装的,不知道在哪里所以用find命令查找的。
find / -name rabbit.app
/usr/lib/rabbitmq/lib/rabbitmq_server-3.6.6/ebin/rabbit.app
2.vim /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.6/ebin/rabbit.app
大概在42行,删除里面的guest用户,修改为如何格式,然后保存。
3.重启服务即可
systemctl restart rabbitmq-server