请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

rabbitmq-server stop无法停止rabbitmp-server

我的操作步骤:
在CentOS系统下面,我运行下面的命令:

[vagrant@rabbitmq-centos ~]$ sudo rabbitmq-server start

  ##  ##
  ##  ##      RabbitMQ 3.7.14. Copyright (C) 2007-2019 Pivotal Software, Inc.
  ##########  Licensed under the MPL.  See https://www.rabbitmq.com/
  ######  ##
  ##########  Logs: /var/log/rabbitmq/rabbit@rabbitmq-centos.log
                    /var/log/rabbitmq/rabbit@rabbitmq-centos_upgrade.log

              Starting broker...
 completed with 0 plugins.
^Cwarning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
Stopping and halting node rabbit@rabbitmq-centos ...
Gracefully halting Erlang VM
[vagrant@rabbitmq-centos ~]$

这样的问题是,当前的terminal不能干其他事情了,只能Ctrl + C,关掉rabbitmq-server.
然后,尝试老师课程中的命令(多加一个&)

[vagrant@rabbitmq-centos ~]$ sudo rabbitmq-server start &
[1] 9369
[vagrant@rabbitmq-centos ~]$
  ##  ##
  ##  ##      RabbitMQ 3.7.14. Copyright (C) 2007-2019 Pivotal Software, Inc.
  ##########  Licensed under the MPL.  See https://www.rabbitmq.com/
  ######  ##
  ##########  Logs: /var/log/rabbitmq/rabbit@rabbitmq-centos.log
                    /var/log/rabbitmq/rabbit@rabbitmq-centos_upgrade.log

              Starting broker...
 completed with 0 plugins.

这样,系统会停在那里,只要点击一下回车,terminal就可以用了。

问题:

但是,执行命令 sudo rabbitmq-server start & 之后,我无法通过一下两个命令关闭RabbitMQ Server:

sudo rabbitmq-server stop
sudo rabbitmqctl stop_app

我系统里的运行结果如下:

[vagrant@rabbitmq-centos ~]$ sudo rabbitmq-server stop
ERROR: node with name "rabbit" already running on "rabbitmq-centos"
[vagrant@rabbitmq-centos ~]$ sudo rabbitmqctl stop_app
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
Stopping rabbit application on node rabbit@rabbitmq-centos ...

我现在只能通过ps aux | grep “rabbit”,获得进程后,一个个关掉。
我查资料,可以通过sudo rabbitmq-server status可以查看RabbitMQ的运行状态,但是我运行结果如下:

[vagrant@rabbitmq-centos ~]$ sudo rabbitmq-server status
ERROR: node with name "rabbit" already running on "rabbitmq-centos"

请问怎么要操作才能通过sudo rabbitmq-server stop 这样简单的命令关掉? 谢谢!

正在回答 回答被采纳积分+3

2回答

阿神 2019-06-07 16:14:17

这个问题说明erlang的node已经启动,此时如果rabbitmq-server stop会无法停止,报节点已经启动的错误,需用
rabbitmqctl  stop_app 这个命令来停止erlang上的node,然后再stop即可

0 回复 有任何疑惑可以回复我~
阿神 2019-06-07 15:59:03

这个关闭的方式不对,首先应该关闭APP应用,然后再关闭server服务

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信