RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统。他遵循Mozilla Public License开源协议。
1:安装RabbitMQ
需要先安装Erlang语言开发包。下载地址 http://www.erlang.org/download.html 在win7下安装Erlang最好默认安装。
配置环境变量 ERLANG_HOME C:Program Files (x86)erl5.9
添加到PATH %ERLANG_HOME%in;
2:安装RabbitMQ
下载地址 http://www.rabbitmq.com/download.html 安装教程:http://www.rabbitmq.com/install-windows.html
配置环境变量 C:Program Files (x86)RabbitMQ Server abbitmq_server-2.8.0
添加到PATH %RABBITMQ_SERVER%sbin;
3:进入%RABBITMQ_SERVER%sbin 目录以管理员身份运行 rabbitmq-plugins.bat
rabbitmq-plugins.bat enable rabbitmq_management
安装完成之后以管理员身份启动 rabbitmq-service.bat
rabbitmq-service.bat stop rabbitmq-service.bat install rabbitmq-service.bat start
4:浏览器访问localhost:15672 默认账号:guest 密码:guest
下面我们使用rabbitmqctl控制台命令(位于%RABBITMQ_SERVER%sbin>)来创建用户,密码,绑定权限等。
%RABBITMQ_SERVER%sbin 的目录
D:Program FilesRabbitMQ Server abbitmq_server-3.6.5sbin>rabbitmqctl.ba t list_users Listing users ... guest [administrator] ...done. D:Program FilesRabbitMQ Server abbitmq_server-3.6.5sbin>rabbitmqctl.ba t list_vhosts Listing vhosts ... / ...done. D:Program FilesRabbitMQ Server abbitmq_server-3.6.5sbin>rabbitmqctl.ba t add_user geffzhang zsy@2014 Creating user "geffzhang" ... ...done. D:Program FilesRabbitMQ Server abbitmq_server-3.6.5sbin>rabbitmqctl.ba t list_users Listing users ... geffzhang [] guest [administrator] ...done. D:Program FilesRabbitMQ Server abbitmq_server-3.6.5sbin>rabbitmqctl.ba t set_user_tags geffzhang administrator Setting tags for user "geffzhang" to [administrator] ... ...done. c:Program Files (x86)RabbitMQ Server abbitmq_server-3.2.3sbin>rabbitmqctl.ba t set_permissions -p / geffzhang ".*" ".*" ".*" Setting permissions for user "geffzhang" in vhost "/" ... ...done. D:Program FilesRabbitMQ Server abbitmq_server-3.6.5sbin>rabbitmqctl.ba t list_users Listing users ... geffzhang [administrator] guest [administrator] ...done.
其他问题:
1、rabbitmq网页管理不成功,需要先开启节点
先执行 rabbitmqctl start_app
再执行 rabbitmq-plugins enable rabbitmq_management