【先定一个小目标】windows下安装RabbitMQ消息服务器

 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%\bin;

2:安装RabbitMQ

  下载地址 http://www.rabbitmq.com/download.html  安装教程:http://www.rabbitmq.com/install-windows.html

      配置环境变量 C:\Program Files (x86)\RabbitMQ Server\rabbitmq_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 Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin>rabbitmqctl.ba 
t list_users 
Listing users ... 
guest   [administrator] 
...done.

D:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin>rabbitmqctl.ba 
t list_vhosts 
Listing vhosts ... 
/ 
...done.

D:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin>rabbitmqctl.ba 
t add_user geffzhang zsy@2014 
Creating user "geffzhang" ... 
...done.

D:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin>rabbitmqctl.ba 
t list_users 
Listing users ... 
geffzhang       [] 
guest   [administrator] 
...done.

D:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin>rabbitmqctl.ba 
t set_user_tags geffzhang administrator 
Setting tags for user "geffzhang" to [administrator] ... 
...done.

c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin>rabbitmqctl.ba
t set_permissions -p /  geffzhang ".*" ".*" ".*"
Setting permissions for user "geffzhang" in vhost "/" ...
...done.

D:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin>rabbitmqctl.ba 
t list_users 
Listing users ... 
geffzhang       [administrator] 
guest   [administrator] 
...done.

  

 

其他问题:

1、rabbitmq网页管理不成功,需要先开启节点

先执行 rabbitmqctl start_app
再执行 rabbitmq-plugins enable rabbitmq_management

  

posted @ 2016-09-13 16:14  疯狂蚂蚁工  阅读(281)  评论(0编辑  收藏  举报