我的操作步骤:
在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 这样简单的命令关掉? 谢谢!