直接通过
rabbitmq-server
启动RabbitMQ,控制台信息
2022-12-04 09:44:53.132784+08:00 [notice] <0.222.0> Logging: switching to configured handler(s); following messages may not be visible in this log output
## ## RabbitMQ 3.10.6
## ##
########## Copyright (c) 2007-2022 VMware, Inc. or its affiliates.
###### ##
########## Licensed under the MPL 2.0. Website: https://rabbitmq.comErlang: 23.3.4.11 [emu]
TLS Library: OpenSSL - OpenSSL 1.0.2k-fips 26 Jan 2017Doc guides: https://rabbitmq.com/documentation.html
Support: https://rabbitmq.com/contact.html
Tutorials: https://rabbitmq.com/getstarted.html
Monitoring: https://rabbitmq.com/monitoring.htmlLogs: /var/log/rabbitmq/rabbit@centos7.log
/var/log/rabbitmq/rabbit@centos7_upgrade.log
<stdout>Config file(s): (none)
Starting broker... completed with 4 plugins.
查看web页面
提示信息
Virtual host / experienced an error on node rabbit@centos7 and may be inaccessible
动态查看完整日志
tail -f -n 100 /var/log/rabbitmq/rabbit@centos7.log
发现如下关键错误信息
2022-12-04 09:44:55.353814+08:00 [info] <0.440.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> crasher:
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> initial call: rabbit_msg_store:init/1
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> pid: <0.440.0>
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> registered_name: []
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> exception exit: {{badmatch,
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> {error,
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> {"/var/lib/rabbitmq/mnesia/rabbit@centos7/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L/msg_store_transient/0.rdq",
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> eacces}}},
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> [{rabbit_msg_store,init,1,
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> [{file,"rabbit_msg_store.erl"},{line,732}]},
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> {gen_server2,init_it,6,
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> [{file,"gen_server2.erl"},{line,565}]},
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> {proc_lib,init_p_do_apply,3,
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> [{file,"proc_lib.erl"},{line,226}]}]}
2022-12-04 09:44:55.354276+08:00 [error] <0.440.0> in function gen_server2:init_it/6 (gen_server2.erl, line 608)
有个词
eacces:无存取权限 /创建指定类型的套接字失败 /文件或路径名中包含的目录不可访问
于是查看对应目录权限:
ll /var/lib/rabbitmq/mnesia/rabbit@centos7/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L/msg_store_transient/
[root@centos7 ~]# ll /var/lib/rabbitmq/mnesia/rabbit@centos7/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L/
总用量 20
drwxr-xr-x. 2 rabbitmq rabbitmq 4096 8月 6 13:56 msg_store_persistent
drwxr-xr-x. 2 root root 4096 8月 6 13:56 msg_store_transient
drwxr-xr-x. 11 rabbitmq rabbitmq 4096 8月 6 12:54 queues
-rw-r--r--. 1 rabbitmq rabbitmq 5464 12月 4 09:44 recovery.dets
[root@centos7 ~]# ll /var/lib/rabbitmq/mnesia/rabbit@centos7/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L/msg_store_transient/
总用量 12
-rw-r--r--. 1 root root 0 8月 6 12:07 0.rdq
-rw-r--r--. 1 root root 61 8月 6 13:56 clean.dot
-rw-r--r--. 1 root root 604 8月 6 13:56 file_summary.ets
-rw-r--r--. 1 root root 530 8月 6 13:56 msg_store_index.ets
修改目录权限
chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/mnesia/rabbit@centos7/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L/msg_store_transient/
重新启动RabbitMQ,可以看到处理之前因权限问题的一些错误提示,并汇总提示如下
2022-12-04 10:14:27.740710+08:00 [info] <0.435.0> Recovering 10 queues of type rabbit_classic_queue took 44ms文章来源:https://www.toymoban.com/news/detail-689412.html
查看网页,也不再提示该错误信息。文章来源地址https://www.toymoban.com/news/detail-689412.html
到了这里,关于RabbitMQ error: Virtual host / experienced an error on node rabbit@centos7 and may be inaccessible的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!