我怎么知道RabbitMQ应用程序是否已经启动 [英] How can I know whether RabbitMQ application has started
问题描述
我有一个C#代码,在Windows Server 2012 R2上安装了Rabbitmq 3.7.4,erlang 20.2,我需要知道应用程序(而非服务)何时启动。运行 rabbitmq-service install
和 rabbitmq-service start
后,我正在寻找一个命令行,该命令行指示应用程序正在运行。我知道 wait pid_file,wait --pid pid
命令,但是无法在我的计算机上找到pid文件。 documantaion表示:
I have a c# code that installs rabbitmq 3.7.4, erlang 20.2 on windows server 2012 R2 and I need to know when the application (not the service) has started. After running rabbitmq-service install
and rabbitmq-service start
I'm looking for a command line that will indicate that the application is running. I'm aware of the wait pid_file, wait --pid pid
command but can't locate the pid file on my machine. The documantaion says:
此命令将等待RabbitMQ应用程序在节点上启动。如果指定了pidfile,它将等待创建pid文件。
This command will wait for the RabbitMQ application to start at the node. It will wait for the pid file to be created if pidfile is specified
指定的位置?
rabbitmq-echopid.bat返回:
rabbitmq-echopid.bat returns:
系统找不到指定的路径。
The system cannot find the path specified.
推荐答案
在Windows上,RabbitMQ默认情况下不会创建PID文件,因此您必须先找到PID,然后以一个参数: rabbitmqctl.bat wait -P PID
On Windows, RabbitMQ does not create a PID file by default, so you have to discover the PID and then pass it as an argument: rabbitmqctl.bat wait -P PID
要发现PID,可以使用以下命令运行以下命令RabbitMQ节点的名称:
To discover the PID, you can run the following using the name of your RabbitMQ node:
.\rabbitmq-echopid.bat rabbit@my-hostname
这时,存在一个错误,其中系统找不到...
将在回显PID之前回显。我提交了此错误,并且很快就会修复,但与此同时您可以编辑 rabbitmq-echopid.bat
脚本,将!TDP0!
更改为%TDP0 %
。
At this time, there is a bug where The system cannot find...
will be echoed before the PID is echoed. I filed this bug and will have a fix in soon, but in the meantime you can edit the rabbitmq-echopid.bat
script to change !TDP0!
to %TDP0%
.
您还可以使用任何其他Windows工具来找到 erl.exe $的PID。运行RabbitMQ的c $ c>进程-有关
wmic.exe
的示例,请参见脚本,也可以使用 tasklist
或Powershell等。
You can also use any other Windows tool to find the PID of the erl.exe
process running RabbitMQ - see the script for an example of wmic.exe
, or you could use tasklist
, or Powershell, etc.
这篇关于我怎么知道RabbitMQ应用程序是否已经启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!