Windows下安装RabbitMQ需要以下几个步骤

   (1):下载erlang,原因在于RabbitMQ服务端代码是使用并发式语言erlang编写的,下载地址:http://www.erlang.org/downloads,双击.exe文件进行安装就好,安装完成之后创建一个名为ERLANG_HOME的环境变量,其值指向erlang的安装目录,同时将%ERLANG_HOME%\bin加入到Path中,最后打开命令行,输入erl,如果出现erlang的版本信息就表示erlang语言环境安装成功;

rabbitmq安装及cookie问题

rabbitmq安装及cookie问题                      

 

   (2):下载RabbitMQ,下载地址:http://www.rabbitmq.com/,同样双击.exe进行安装就好(这里需要注意一点,貌似RabbitMQ安装目录中是不允许有空格的);

   (3):安装RabbitMQ-Plugins,这个相当于是一个管理界面,方便我们在浏览器界面查看RabbitMQ各个消息队列以及exchange的工作情况,安装方法是:打开命令行cd进入rabbitmq的sbin目录(我的目录是:E:\software\rabbitmq\rabbitmq_server-3.6.5\sbin),输入:rabbitmq-plugins enable rabbitmq_management命令,稍等会会发现出现plugins安装成功的提示,默认是安装6个插件,如果你在安装插件的过程中出现了下面的错误:        

rabbitmq安装及cookie问题

   解决方法是:首先在命令行输入:rabbitmq-service stop,接着输入rabbitmq-service remove,再接着输入rabbitmq-service install,接着输入rabbitmq-service start,最后重新输入rabbitmq-plugins enable rabbitmq_management试试,我是这样解决的;

   (4):插件安装完之后,在浏览器输入http://localhost:15672进行验证,你会看到下面界面,输入用户名:guest,密码:guest你就可以进入管理界面,当然用户名密码你都可以变的;


安装异常情况

1、安装完rabbitmq后执行rabbitmqctl status会报please check the Erlang cookie的错误

DIAGNOSTICS
===========

attempted to contact: ['[email protected]']

[email protected]:
  * connected to epmd (port 4369) ondongnan-PC
  * epmd reports node 'rabbit' running on port25672
  * TCP connection succeeded but Erlangdistribution failed

  * Authentication failed (rejected by the remotenode), please check the Erlang
 cookie

current node details:
- node name: '[email protected]'
- home dir: C:\Users\dongnan

- cookie hash: GqqcRVa4X0hiAIlhRYUDkA==

网上查的解决方案如下

Synchronise Erlang Cookies (when running a manually installedWindows Service)

Erlang Security Cookies used by the service account and the userrunning rabbitmqctl.bat must besynchronised for rabbitmqctl.bat tofunction.

To ensure Erlang cookie files contain the same string, copy the.erlang.cookie file from the Windowsdirectory (normallyC:\WINDOWS\.erlang.cookie) to replace the user.erlang.cookie. The user cookie will bein the user's home directory (%HOMEDRIVE%%HOMEPATH%),e.g.C:\Documents and Settings\%USERNAME%\.erlang.cookie or C:\Users\%USERNAME%\.erlang.cookie (Windows Vista andlater).

需要将windows下的erlang.cookie覆盖到user下的erlang.cookie

但是苦于windows下未找到erlang.cookie

再次上网查询解决方案,从rabbitmq日志找到如下信息

node           : [email protected]
home dir       : C:\Windows\system32\config\systemprofile
config file(s) : c:/Users/dongnan/AppData/Roaming/RabbitMQ/advanced.config

cookie hash    : qhOGp9TtH4Rn+BekiYXxIg==

从homedir路径下找到了erlang.cookie,覆盖到user下rabbitmq节点可以正常启动


相关文章:

  • 2021-10-31
  • 2021-10-24
  • 2021-05-16
  • 2021-11-10
  • 2021-07-08
  • 2021-11-17
  • 2021-11-17
  • 2021-07-14
猜你喜欢
  • 2021-11-26
  • 2021-09-13
  • 2021-10-16
  • 2022-02-20
  • 2021-10-26
  • 2021-06-14
  • 2021-12-17
相关资源
相似解决方案