0

我正准备用 Chef 安装 Sensu,但 RabbitMQ 似乎无法正常工作。rabbitmq-server的服务没有启动,即使erlang和RabbitMQ安装成功。

rabbitMQ的错误说

Error: unable to connect to node rabbit@localhost: nodedown

rabbitmq service has already started

于是我用ps命令检查了rabbitmq的进程。

ps aux |grep rabbitmq

肯定有一个进程正在使用 rabbitmq 用户运行

/usr/lib64/erlang/erts-6.1/bin/epmd -daemon

我杀死了那个进程,并重新启动了 rabbitmq-server 服务。但是无法启动rabbitmq-server,并且显示相同的日志并且发生了相同的事情。

我曾经删除了erlang和rabbitmq并重新安装了它们,但结果是一样的。

以下为详细内容。

服务器

OS: CentOS 6.5

Related installed packages
erlang.x86_64       17.1-1.1.el6
rabbitmq-server.noarch      3.1.5-1.el6

原始日志

# /etc/init.d/rabbitmq-server status


Status of node rabbit@localhost ...
Error: unable to connect to node rabbit@localhost: nodedown

DIAGNOSTICS
===========

nodes in question: [rabbit@localhost]

hosts, their running nodes and ports:
- localhost: [{rabbitmqctl23036,37270}]

current node details:
- node name: rabbitmqctl23036@localhost
- home dir: /var/lib/rabbitmq
- cookie hash: Tghu0ucbQ4pq3Sc0JJBbAg==



# tail /var/log/rabbitmq/rabbit\@localhost.log



=INFO REPORT==== 6-Aug-2014::14:59:15 ===
Starting RabbitMQ 3.1.5 on Erlang 17
Copyright (C) 2007-2013 GoPivotal, Inc.
Licensed under the MPL.  See http://www.rabbitmq.com/

=INFO REPORT==== 6-Aug-2014::14:59:15 ===
node           : rabbit@localhost
home dir       : /var/lib/rabbitmq
cookie hash    : 9qNy1Q7BP12PVVcbSnZwRw==
log            : /var/log/rabbitmq/rabbit@localhost.log
sasl log       : /var/log/rabbitmq/rabbit@localhost-sasl.log
database dir   : /var/lib/rabbitmq/mnesia/rabbit@localhost

=INFO REPORT==== 6-Aug-2014::14:59:15 ===
Limiting to approx 924 file handles (829 sockets)

=INFO REPORT==== 6-Aug-2014::14:59:15 ===
Memory limit set to 802MB of 2006MB total.

=INFO REPORT==== 6-Aug-2014::14:59:15 ===
Disk free limit set to 1000MB

=INFO REPORT==== 6-Aug-2014::14:59:15 ===
msg_store_transient: using rabbit_msg_store_ets_index to provide index

=INFO REPORT==== 6-Aug-2014::14:59:15 ===
msg_store_persistent: using rabbit_msg_store_ets_index to provide index

=INFO REPORT==== 6-Aug-2014::14:59:15 ===
started TCP Listener on [::]:5672

=INFO REPORT==== 6-Aug-2014::14:59:15 ===
Error description:
   {case_clause,{error,{already_started,<0.193.0>}}}

Log files (may contain more information):
   /var/log/rabbitmq/rabbit@localhost.log
   /var/log/rabbitmq/rabbit@localhost-sasl.log

Stack trace:
   [{rabbit_networking,start_listener0,4,[]},
    {rabbit_networking,'-start_listener/4-lc$^0/1-0-',4,[]},
    {rabbit_networking,start_listener,4,[]},
    {rabbit_networking,'-boot_ssl/0-lc$^0/1-0-',1,[]},
    {rabbit_networking,boot_ssl,0,[]},
    {rabbit_networking,boot,0,[]},
    {rabbit,'-run_boot_step/1-lc$^1/1-1-',1,[]},
    {rabbit,run_boot_step,1,[]}]


=INFO REPORT==== 6-Aug-2014::14:59:16 ===
stopped TCP Listener on [::]:5672

=INFO REPORT==== 6-Aug-2014::14:59:16 ===
Error description:
   {could_not_start,rabbit,
       {bad_return,
           {{rabbit,start,[normal,[]]},
            {'EXIT',
                {rabbit,failure_during_boot,
                    {case_clause,{error,{already_started,<0.193.0>}}}}}}}}

Log files (may contain more information):
   /var/log/rabbitmq/rabbit@localhost.log
   /var/log/rabbitmq/rabbit@localhost-sasl.log
4

1 回答 1

0

看起来 RabbitMQ(5672准确地说)正在使用的端口已经被占用。或者在你的情况下,它可能仍然被采取。如果您杀死在某个端口上打开套接字的应用程序,您就没有给它时间正确关闭此连接。系统最终会注意到这一点并释放资源,但这可能需要一些时间。所以你可以做的是稍等,或者改变RabbitMQ 配置

希望这对您的一些问题有所帮助。

于 2014-08-11T12:05:50.853 回答