以下五步转自:https://blog.csdn.net/shushugood/article/details/81076917 部分内容稍有修改。
一、安装RabbitMQ需要先安装Erlang语言开发包 下载地址https://www.erlang.org/downloads本文下载的是22.2版本。下载安装完成后(例如安装在E:\erl10.6下) 需要添加环境变量 ERLANG_HOME=E:\erl10.6 之后在Path中添加 %ERLANG_HOME%\bin
二、安装RabbitMQ Server 下载地址https://www.rabbitmq.com/download.html本文下载的是3.8.2版本。下载完成后(例如安装在E:\RabbitMQ Server\rabbitmq_server-3.8.2)添加环境变量RABBITMQ_SERVER=E:\RabbitMQ Server\rabbitmq_server-3.8.2 在path中添加 %RABBITMQ_SERVER%\sbin
三、以管理员身份运行cmd.exe,进入目录 E:\RabbitMQ Server\rabbitmq_server-3.8.2\sbin(RabbitMQ Server安装目录),运行cmd命令:rabbitmq-plugins.bat enable rabbitmq_management
四、以管理员身份运行cmd.exe,运行命令:net stop RabbitMQ && net start RabbitMQ。启动RabbitMQ Server,
五、在浏览器输入地址:http://localhost:15672,输入默认账号:guest 密码:guest。
补充:
在搭建完环境之后启动已有java项目连接mq,配置文件
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
virtual-host: center
发现报错
2020-02-03 15:55:23 [AMQP Connection 127.0.0.1:5672] ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler 124 - An unexpected connection driver error occured
java.net.SocketException: socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.