環境說明:
Erlang:OTP 21.0.1 Windows 64-bit Binary File (91707927)
RabbitMQ:rabbitmq-server-3.7.6.exe
問題一:運行rabbitmq命令是出現“編譯錯誤”,rabbitmq windows initial call: application_master:init/4
部分錯誤信息:
crasher:
initial call: application_master:init/4
pid: <0.108.0>
registered_name: []
exception exit: {bad_return,{{rabbit,start,[normal,[]]},
{'EXIT',{rabbit,failure_during_boot}}}}
in function application_master:init/4 (application_master.erl, line
138)
ancestors: [<0.107.0>]
messages: [{'EXIT',<0.109.0>,normal}]
links: [<0.107.0>,<0.7.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 2584
stack_size: 24
reductions: 246
問題原因:Erlang版本與RabbitMQ版本不匹配
處理方案:降級Erlang,安裝低一個版本的Erlang(OTP 20.3 Windows 64-bit Binary File (99142192))
問題二:Erlang cookie hash: d0/aJ4PjGiGc1JqNZoADCg
部分錯誤信息:
[email protected]:
* connected to epmd (port 4369) on hailiang.xu
* epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
* TCP connection succeeded but Erlang distribution failed
* Authentication failed (rejected by the remote node), please check the Erlang cookie
Current node details:
* node name: [email protected]
* effective user's home directory: C:\Users\hailiang.xu
* Erlang cookie hash: d0/aJ4PjGiGc1JqNZoADCg
問題原因:可能是兩個目錄下.erlang.cookie文件不匹配(官網),也可能是其他原因
處理方案:
1、保持兩個目錄下的.erlang.cookie文件內容一致
詳細閱讀:http://www.rabbitmq.com/cli.html
With Erlang versions starting with 20.2, the cookie file locations are:
%HOMEDRIVE%%HOMEPATH%\.erlang.cookie (usually C:\Users\%USERNAME%\.erlang.cookie for user %USERNAME%) if both the HOMEDRIVE and HOMEPATH environment variables are set
%USERPROFILE%\.erlang.cookie (usually C:\Users\%USERNAME%\.erlang.cookie) if HOMEDRIVE and HOMEPATH are not both set
For the RabbitMQ Windows service - %USERPROFILE%\.erlang.cookie (usually C:\WINDOWS\system32\config\systemprofile)
If the Windows service is used, the cookie should be copied from C:\Windows\system32\config\systemprofile\.erlang.cookie to the expected location for users running commands like rabbitmqctl.bat.
2、重新安裝service RabbitMQ(在嘗試方法1無效之後用方法2解決問題的)
C:\windows\system32>rabbitmq-service stop 前面已經停止了RabbitMQ服務,所以這裏會提示沒有啓動RabbitMQ服務
沒有啓動 RabbitMQ 服務。
請鍵入 NET HELPMSG 3521 以獲得更多的幫助。
C:\windows\system32>rabbitmq-service remove
E:\softwareInstall\study\erl9.3\erts-9.3\bin\erlsrv: Service RabbitMQ removed from system.
C:\windows\system32>rabbitmq-service install
E:\softwareInstall\study\erl9.3\erts-9.3\bin\erlsrv: Service RabbitMQ added to system.
最終環境:
Erlang:OTP 20.3 Windows 64-bit Binary File (99142192)
RabbitMQ:rabbitmq-server-3.7.6.exe