[rabbitmq-discuss] Correct way of determining which node is master?

aminer at groupon.com aminer at groupon.com
Tue Feb 5 20:11:17 GMT 2013


I'm faced with much the same issue Matt P. mentions, but I wanted to make 
sure I understand how this works.  Is the following correct?

The system is set up to have a set of three hosts each running a single 
RabbitMQ node.  A load-balancer routes traffic evenly between all the 
nodes, and has a health-check to determine whether each node is active and 
healthy.  The entire cluster is served by a single external IP address 
(which points to the load balancer).

Within the cluster, let's say I have a topic exchange, and a number of 
clients who each subscribe to a specific topic (several clients to a topic) 
by creating a permanent, named queue for themselves and binding it to the 
exchange.  The messages come from another server whose sole function is to 
generate these messages and publish them to the exchange.  Let's assume 
everyone connects successfully and a while passes during which everyone 
gets their messages as expected.

Then, one node fails.  The load balancer detects this and stop routing new 
connections to that machine.  All clients connected to that node lose their 
connections and re-connect (through the load balancer) to one of the 
functioning nodes.  They re-subscribe to their named queues, and find all 
the messages they missed while they were re-connecting are waiting for them 
(assuming the mirroring was up-to-date when the one node failed), and 
continue to receive all new messages posted to their topics.

The server publishing the messages opens and closes its connection each 
time it needs to publish a message, so it notices nothing.  The load 
balancer automatically routes it to a functioning node, and publishes to 
the exchange which automatically routes the message to the queue no matter 
what node is current the master node for that queue.

Am I missing anything here?  Thanks very much for any help!


On Wednesday, February 22, 2012 12:10:05 PM UTC-8, Matthew Sackman wrote:
>
> On Wed, Feb 22, 2012 at 10:39:04AM -0800, Matt Pietrek wrote:
> > | Messages are *always* read from the master node (for a given queue).
> > 
> > This is very helpful. Going a step further, is it true to say that in a
> > cluster where we mirror all queues, there's really no benefit to 
> assigning
> > the VIP to one node over another?
>
> Correct, though for performance reasons you might like to ensure the
> masters are roughly uniformly spread over all the nodes.
>
> Matthew
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq... at lists.rabbitmq.com <javascript:>
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130205/d7dc9fad/attachment.htm>


More information about the rabbitmq-discuss mailing list