爲了方便工做中使用,週末抽空對 rabbitmq-echopid 用戶手冊進行了翻譯,鑑於本身水平有限,翻譯中不免有紕漏產生,若是疑問,歡迎指出探討。 html
官方原文:http://www.rabbitmq.com/man/rabbitmq-echopid.man.html node
================= 我是分割線 ================== shell
經過 http://www.rabbitmq.com/manpages.html 可知 RabbitMQ 有5個 General Command : ide
1. rabbitmqctl5. rabbitmq-echopid ui
若要對 server 進行高級配置,則須要參考 administrator's guide(http://www.rabbitmq.com/admin-guide.html) spa
@echo off REM Usage: rabbitmq-echopid.bat <rabbitmq_nodename> REM REM <rabbitmq_nodename> sname of the erlang node to connect to (required) setlocal if "%1"=="" goto fail :: set timeout vars :: set TIMEOUT=10 set TIMER=1 :: check that wmic exists :: set WMIC_PATH=%SYSTEMROOT%\System32\Wbem\wmic.exe if not exist "%WMIC_PATH%" ( goto fail ) :getpid for /f "usebackq tokens=* skip=1" %%P IN (`%%WMIC_PATH%% process where "name='erl.exe' and commandline like '%%-sname %1%%'" get processid 2^>nul`) do ( set PID=%%P goto echopid ) :echopid :: check for pid not found :: if "%PID%" == "" ( PING 127.0.0.1 -n 2 > nul set /a TIMER+=1 if %TIMEOUT%==%TIMER% goto fail goto getpid ) :: show pid :: echo %PID% :: all done :: :ok endlocal EXIT /B 0 :: something went wrong :: :fail endlocal EXIT /B 1