我怎么知道RabbitMQ应用程序是否已经启动

编程入门 行业动态 更新时间:2024-10-27 22:20:33
本文介绍了我怎么知道RabbitMQ应用程序是否已经启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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 进程-有关 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应用程序是否已经启动

本文发布于:2023-08-02 13:25:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1278167.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   我怎么   RabbitMQ

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!