1. rabbitmq启动失败
修改主机名称后使用命令启动rabbitmq节点报错:
[root@centos72 ~]# RABBITMQ_NODE_PORT=5672 RABBITMQ_NODENAME=rabbit rabbitmq-server &
[1] 2889
[root@centos72 ~]# Activating RabbitMQ plugins ...
********************************************************************************
*WARNING* Undefined function global:safe_whereis_name/1
********************************************************************************
0 plugins activated:
+---+ +---+
| | | |
| | | |
| | | |
| +---+ +-------+
| |
| RabbitMQ +---+ |
| | | |
| v2.7.0 +---+ |
| |
+-------------------+
AMQP 0-9-1 / 0-9 / 0-8
Copyright (C) 2007-2011 VMware, Inc.
Licensed under the MPL. See http://www.rabbitmq.com/
node : rabbit@centos72
app descriptor : /usr/local/rabbitmq_server-2.7.0/sbin/../ebin/rabbit.app
home dir : /root
config file(s) : (none)
cookie hash : EA2kofbz66IQpSOKqLWrJQ==
log : /var/log/rabbitmq/rabbit.log
sasl log : /var/log/rabbitmq/rabbit-sasl.log
database dir : /var/lib/rabbitmq/mnesia/rabbit
erlang version : 5.10.3
-- rabbit boot start
starting file handle cache server ...done
starting worker pool ...done
starting database ...BOOT ERROR: FAILED
Reason: {error,
{timeout_waiting_for_tables,
[rabbit_user,rabbit_user_permission,rabbit_vhost,
rabbit_listener,rabbit_durable_route,
rabbit_semi_durable_route,rabbit_route,rabbit_reverse_route,
rabbit_topic_trie_edge,rabbit_topic_trie_binding,
rabbit_durable_exchange,rabbit_exchange,
rabbit_exchange_serial,rabbit_durable_queue,rabbit_queue,
gm_group,mirrored_sup_childspec]}}
Stacktrace: [{rabbit_mnesia,wait_for_tables,1,[]},
{rabbit_mnesia,check_schema_integrity,0,[]},
{rabbit_mnesia,ensure_schema_integrity,0,[]},
{rabbit_mnesia,init,0,[]},
{rabbit,'-run_boot_step/1-lc$^1/1-1-',1,[]},
{rabbit,run_boot_step,1,[]},
{rabbit,'-start/2-lc$^0/1-0-',1,[]},
{rabbit,start,2,[]}]
[os_mon] cpu supervisor port (cpu_sup): Erlang has closed
{"Kernel pid terminated",application_controller,"{application_start_failure,rabbit,{bad_return,{{rabbit,start,[normal,[]]},{'EXIT',{rabbit,failure_during_boot}}}}}"}
解释如下:
Alternatively, perhaps your mnesia dir (/var/lib/rabbitmq/mnesia/rabbit)
got into a a weird state. Try clearing it.
即分布式数据库mnesia异常。
解决:
(1) 将/var/lib/rabbitmq/mnesia/rabbit/下的数据库文件清空即可,具体清空哪个节点需要根据自己情况选择。
(2) 重启节点