Tens of thousands of PV sites RABBITMQ installation, cluster

Source: Internet
Author: User
Tags rabbitmq

  • What is RABBITMQ?

    MQ is all called the message queue, and Message Queuing (MQ) is an application-to-application communication method. Applications communicate by reading and writing messages to and from the queue (data for the application), without requiring a dedicated connection to link them. Message passing refers to the process of communicating between programs by sending data in a message, rather than by directly invoking each other, and directly invoking techniques such as remote procedure calls. Queuing refers to an application communicating through a queue. The use of queues removes the requirement that both the receiving and sending applications execute concurrently.

  • RABBITMQ concept
    • Broker: The Message Queuing server entity is simply the case.
    • Exchange: A message switch that specifies what rules the message is routed to and to which queue.
    • Queue: A message queue carrier in which each message is put into one or more queues.
    • Binding: Bind, which is the role of binding exchange and queue according to routing rules.
    • Routing key: The routing keyword, exchange messages are delivered based on this keyword.
    • Vhost: Virtual host, a broker can open multiple vhost, as a separate user permissions.
    • Producer: The message producer is the program that delivers the message.
    • Consumer: The message consumer is the program that receives the message.
    • Channel: The message channels, in each connection of the client, multiple channels can be established, each channel represents a session task.
    Host name IP Use
    Rabbitmq01 192.168.200.128 Disk node
    Rabbitmq02 192.168.200.129 Memory nodes
    Rabbitmq03 192.168.200.130 Memory nodes
      • Installing RABBITMQ
      • 1: Need to configure three nodes of the Hosts file, the following content is added to three servers respectively.

        vim /etc/hostname    //其他两台为rabbitmq02、rabbitmq03    rabbitmq01.localdomain# vim /etc/hosts  //添加下面三行192.168.200.128 rabbitmq01192.168.200.129 rabbitmq02192.168.200.130 rabbitmq03# init 6  //重启# service firewalld stop# setenforce 0
      • 2: Install the RABBITMQ software.

        # yum install epel-release -y     //安装epel源# yum install -y rabbitmq-server  //安装软件# rabbitmq-plugins list     //查看插件安装情况# rabbitmq-plugins enable rabbitmq_management //启用rabbitmq_management服务# systemctl start rabbitmq-server.service   //启动rabbitmq服务# netstat -ntap | grep 5672# rabbitmqctl cluster_status  //检查三台的集群状态,目前相互独立,没有形成集群。



      • Building an Erlang cluster

        # systemctl stop rabbitmq-server.service  //停止三台服务器# vi /var/lib/rabbitmq/.erlang.cookie //三台值配置成一样的,复制rabbitmq01的内容到其他两台# systemctl start rabbitmq-server.service
      • operate on 02, 03 nodes

        # rabbitmqctl stop_app# rabbitmqctl join_cluster --ram [email protected] //加入到磁盘节点# rabbitmqctl start_app    

      • Open a browser into web page management
      • Input: http://192.168.200.128:15672/
      • Default User name: Guest Password: Guest


      • Create a policy
      • Name: Policy names
      • Pattern: Matching rule (this is to indicate that the match starts with a, ^ matches all queues)
      • Definition; use all in Ha-mode mode, which is to synchronize all matching queues.
      • Priority: Precedence, default is 0, the higher the value, the greater the priority.


      • Add queue
      • Name: Queue names
      • Durability: Whether the queue is persisted (durable is supported)
      • Auto Delete: Auto Delete
      • Arguments: type of policy used

      • Add a queue message
      • 2-persistent: Indicates persistence, which in turn shows non-persistence.
      • Headers: Fill it out
      • Properties: Click on the question mark, now an ID number
      • Payload: Message Content

    Sleep the rest of tomorrow write

    Tens of thousands of PV sites RABBITMQ installation, cluster

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.