RABBITMQ 3.5.6->3.6.1 Upgrade, instructions for use

Source: Internet
Author: User
Tags message queue rabbitmq

Question 1:

v3.5.6 Erlang Version: r14b

# Rpm-qa | grep Erlang



Action 1:

Stop deleting rabbitmq3.5.6

# Rabbitmqctl Stop

# Rabbitmq-server Start #启动

Action 2:

Rpm-e--allmatches--nodeps ' rpm-qa |grep Erlang '

#安装参考 (yum installation)

# wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
# RPM-UVH erlang-solutions-1.0-1.noarch.rpm
# sudo yum install Erlang
# sudo yum install Esl-erlang

# RPM-IHV rabbitmq-server-3.6.1-1.noarch.rpm

# Rabbitmq-server Start &


----Turn: http://blog.csdn.net/shatty/article/details/9529463

1, basic concept

RABBITMQ is a popular open source Message Queuing system, developed in Erlang language. I used to be interested in this language, studied for some time, and later did not insist. RABBITMQ is the standard implementation of the AMQP (Advanced Message Queuing protocol). If you are unfamiliar with AMQP, it can be difficult to see RABBITMQ documents directly. But it also has only a few key concepts, which are briefly described here. Several concept notes: 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. The use of Message Queuing is probably as follows: (1) The client connects to the Message Queuing server and opens a channel.
(2) The client declares an exchange and sets the related properties.
(3) The client declares a queue and sets the related properties.
(4) The client uses routing key to establish a good binding relationship between Exchange and queue.
(5) Clients post messages to exchange. When Exchange receives a message, it routes messages to one or more queues based on the key of the message and the binding that has been set. There are several types of exchange, which are called direct switches that are delivered entirely according to key, for example, when the routing key is set to "ABC", the client submits a message that only the key "ABC" is set to be posted to the queue. When the key is matched with a pattern, it is called a topic switch, and the symbol "#" matches one or more words, and the symbol "*" matches exactly one word. For example, "abc.#" matches "Abc.def.ghi", "abc.*" matches only "Abc.def". There is also a need for a key, called the fanout Switch, which takes broadcast mode, when a message comes in, it is posted to all queues that are bound to the switch. RABBITMQ supports the persistence of messages, that is, data is written on disk, and for data security reasons, I think most users will choose to persist. Message Queuing persistence consists of 3 parts:
(1) Exchange persistence, specifying durable + 1 at the time of declaration
(2) Queue persistence, specify durable when declaring = 1
(3) Message persistence, specifying Delivery_mode = 2 on delivery (1 non-persistent) if both Exchange and queue are persisted, the binding between them is persistent. If there is a persistence between Exchange and queue, a non-persisted, binding is not allowed. 3.6.1 Upgrade, instructions for use ">
2, Environment constructionBecause I was working on the development of OpenStack, I used Devstack installed RabbitMQ directly on Ubuntu. You can also manually install RabbitMQ (sudo apt-get install rabbitmq-server) on Ubuntu. The RabbitMQ website gives tutorials using the Pika connection RabbitMQ. Devstack default is to connect RabbitMQ with Kombu. So install Pika first.

sudo apt-get install Python-pip git-core
sudo pip install pika==0.9.8
After setting up the environment, you can follow the tutorial. 3, example tutorials 3.1 Production/consumerThe simplest example is to try to send a message to the recipient first (here's the example and the official website tutorial a little different, set the connection parameters and the official website, because the devstack default installation of RABBITMQ modified the guest's password to Nova) 3.6.1 upgrade, use the instructions " >
receiver.py [HTML]  View plain  copy #!/usr/bin/env python   import pika      Credentials = pika. Plaincredentials (' guest ',  ' Nova ')    Parameters = pika. Connectionparameters (' localhost ', 5672, '/',credentials     ')    connection =  pika. Blockingconnection (parameters)    Channel = connection.channel ()       Channel.queue_declare (queue= ' hello ')       print  '  [*] Waiting for  Messages. to exit press ctrl+c '       def callback (Ch, method,  properties, body):       print  " [x] received %r"  %  (body,)       channel.basic_consume (callback,                           queue= ' Hello ',                          no_ack=true)       channel.start_consuming ()    send.py [Python]View Plain copy #!/usr/bin/env python import pika credentials = Pika. Plaincredentials (' guest ', ' Nova ') parameters = Pika. Connectionparameters (' localhost ', 5672, '/', credentials) connection = Pika. Blockingconnection (parameters) Channel = Connection.channel () channel.queue_declare (queue= ' hello ') channel.bas   Ic_publish (exchange= ", routing_key= ' hello ', body= ' Hello world! ') Print

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.