一直在写代码,rabbitMQ突然无效,交换机不能自动创建,手动创建后不显示队列。以下是报错
日志:
tail -n 3 /var/log/rabbitmq/rabbit@localhost.log
查看最近三条日志信息
2023-09-10 18:28:45.521 [info] <0.19504.12> Stopping message store for directory '/var/lib/rabbitmq/mnesia/rabbit@localhost/msg_stores/vhosts/8FNIF8U0IEH2KUBRM3PTMQZJL/msg_store_transient'
2023-09-10 18:28:45.541 [info] <0.497.0> Message store for directory '/var/lib/rabbitmq/mnesia/rabbit@localhost/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L/msg_store_transient' is stopped
2023-09-10 18:28:45.543 [info] <0.19504.12> Message store for directory '/var/lib/rabbitmq/mnesia/rabbit@localhost/msg_stores/vhosts/8FNIF8U0IEH2KUBRM3PTMQZJL/msg_store_transient' is stopped
可以看到rabbitMQ已经未正常运作
状态信息:
[root@192 ~]# rabbitmqctl status
Error: unable to perform an operation on node 'rabbit@192'. Please see diagnostics information and suggestions below.
Most common reasons for this are:
* Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
* CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
* Target node is not running
In addition to the diagnostics info below:
* See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
* Consult server logs on node rabbit@192
* If target node is configured to use long node names, don't forget to use --longnames with CLI tools
DIAGNOSTICS
===========
attempted to contact: [rabbit@192]
rabbit@192:
* unable to connect to epmd (port 4369) on 192: badarg (unknown POSIX error)
Current node details:
* node name: 'rabbitmqcli-3732-rabbit@192'
* effective user's home directory: /var/lib/rabbitmq
* Erlang cookie hash: AcBzHivhGuAhCoTXcR0bMA==
尝试重启时:
[root@localhost sbin]# systemctl restart rabbitmq-server.service
Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
[root@localhost sbin]#
[root@localhost sbin]# systemctl status rabbitmq-server.service
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: activating (start) since 日 2023-09-10 20:27:33 CST; 1s ago
Process: 5487 ExecStop=/usr/sbin/rabbitmqctl shutdown (code=exited, status=69)
Main PID: 86295 (beam.smp)
Tasks: 84
CGroup: /system.slice/rabbitmq-server.service
├─86295 /usr/lib/erlang/erts-11.0.2/bin/beam.smp -W w -K true -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db -zdbbl 128000 -- -root /usr/lib/...
├─86396 erl_child_setup 32768
├─86437 inet_gethost 4
└─86438 inet_gethost 4
9月 10 20:27:33 192.168.209.148 systemd[1]: Stopped RabbitMQ broker.
9月 10 20:27:33 192.168.209.148 systemd[1]: Starting RabbitMQ broker...
9月 10 20:27:34 192.168.209.148 rabbitmq-server[86295]: 20:27:34.444 [error]
9月 10 20:27:34 192.168.209.148 rabbitmq-server[86295]: 20:27:34.449 [error] BOOT FAILED
9月 10 20:27:34 192.168.209.148 rabbitmq-server[86295]: BOOT FAILED
9月 10 20:27:34 192.168.209.148 rabbitmq-server[86295]: 20:27:34.450 [error] ===========
9月 10 20:27:34 192.168.209.148 rabbitmq-server[86295]: ===========
9月 10 20:27:34 192.168.209.148 rabbitmq-server[86295]: 20:27:34.451 [error] ERROR: epmd error for host 192: badarg (unknown POSIX error)
9月 10 20:27:34 192.168.209.148 rabbitmq-server[86295]: ERROR: epmd error for host 192: badarg (unknown POSIX error)
9月 10 20:27:34 192.168.209.148 rabbitmq-server[86295]: 20:27:34.451 [error]
同样是
192: badarg (unknown POSIX error)
chatgpt指出可能是主机名的配置问题。
具体操作参照博客:
省流:
cd /etc/rabbitmq
vim rabbitmq-env.conf
添加:NODENAME=rabbit@localhost
保存
systemctl restart rabbitmq-server
问题解决
已经运行了很久没问题的rabbitMQ,突然间出现。。。耗时半小时
本文链接:https://blog.csdn.net/fvdfsdafdsafs/article/details/89332506
转载自CSDN博主「黄金时代的架构之路」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/fvdfsdafdsafs/article/details/89332506