RabbitMQ Learning Series: RabbitMQ Installation and Configuration

Currently using 3.6.12 cannot enter the background, but it can be configured and used in the program directly after installation.

1. Install

    Rabbit MQ is built on the powerful Erlang OTP platform, so Erlang must be installed before installing RabbitMQ.

    erlang:http://www.erlang.org/download.html

    rabbitmq:http://www.rabbitmq.com/download.html

    Notice:

      1. Don't install the latest 3.6.3 now. After I installed the latest version, there was a problem with the queue queue, which was solved when I lowered it to 3.6.2.

      2. The default installed Rabbit MQ listening port is: 5672

  2. configure

    1. After installation, erlang needs to manually set the system variable of ERLANG_HOME.

    Enter: set ERLANG_HOME=C:\Program Files\erl8.0

     

 

    2. Activate Rabbit MQ's Management Plugin

    Using the Rabbit MQ management plugin, you can view the status of the Rabbit MQ server instance in a better visual way, which you can activate from the command line with the following command.

    输入:rabbitmq-plugins.bat  enable  rabbitmq_management

     

 

    At the same time, we also use the rabbitmqctl console command (located in rabbitmq_server-3.6.3\sbin>) to create users, passwords, bind permissions, etc.

    3. Create an administrative user

    Input: rabbitmqctl.bat add_user zhangweizhong weizhong1988

     

 

    4. Set up administrator

    输入:rabbitmqctl.bat set_user_tags zhangweizhong administrator

     

 

    5.设置权限

    输入:rabbitmqctl.bat set_permissions -p / zhangweizhong ".*" ".*" ".*"

     

 

    6. 其他命令

      a. 查询用户: rabbitmqctl.bat list_users

      b. 查询vhosts: rabbitmqctl.bat list_vhosts

      c. 启动RabbitMQ服务: net stop RabbitMQ && net start RabbitMQ

 

   以上这些,账号、vhost、权限、作用域等基本就设置完了。

 

  3.Rabbit MQ管理后台

    使用浏览器打开http://localhost:15672 访问Rabbit Mq的管理控制台,使用刚才创建的账号登陆系统即可。

    Rabbit MQ 管理后台,可以更好的可视化方式查看RabbitMQ服务器实例的状态。

     

  4. 创建vhosts

    1. 创建vhosts,  在admin页面,点击右侧Virtual Hosts ,

     

 

    2. 将刚创建的OrderQueue分配给相关用户。

     

     3. 其他创建exchange ,queue 大家自己在后台创建吧,这里不再赘述。

 

  好了,RabbitMQ安装与配置就写到这里,后续写c# 程序如何进行连同 rabbitmq 进行 发布、订阅等消息队列操作demo。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326117686&siteId=291194637