[rabbitmq-discuss] Cluster Disk Node vs Ram Node explanation

Matthias Radestock matthias at rabbitmq.com
Sat Sep 3 05:07:55 BST 2011


Rene,

On 30/08/11 17:07, Rene Parra wrote:
> GIVEN:
>     * A load balanced cluster consisting of disk node A, ram node B, and
>       ram node C
>
> WHEN:
>     * A client is routed to ram node B via the load balancer,
>     * AND the client declares a *durable* *queue *on its connection to
>       ram node B,
>     * AND the client declares bindings to a topic exchange being
>       serviced by a producer connected on ram node C;
>
> WHERE are the messages stored?

The messages are stored on the node on which the queue resides / was 
declared. i.e. B.

> WHAT happens to the producer on ram node C when ram node B fails? (Does
> it block? Do messages continue to be delivered? Are messages to the
> client lost?)

The broker will behave as if the queues on B (and their bindings) didn't 
exist (*). So in your example, assuming there are no bindings to queues 
on surviving nodes, any new messages published will be lost. Setting the 
'mandatory' flag on publish will (asynchronously) inform the publisher 
when that happens.

Messages that made it into the queues and were persisted to disk on B 
before the failure are retained and become available again when B recovers.

(*) except it will prevent redeclaration of any durable queue with the 
same name, since that would prevent subsequent recovery of the original 
queue.

> However, I just finished a soak test where my durable queue on ram node
> B lost messages over the weekend due to a network hiccup that crashed
> ram node B. When it came back up again messages were lost. As such, we
> are recommending our production configuration to be unclustered, disk
> node only until we better understand the benefits and use cases
> associated with clustering with RabbitMQ 2.5.1

Until the introduction of HA in the recent 2.6.0 release, clustering was 
predominantly a scalability feature.

> A simple tutorial or explanation of “To Disk Node or To Ram Node... that
> is the question” would be great and useful for those of us implementing,
> learning and teaching rabbit to our organizations.

 From http://www.rabbitmq.com/clustering.html#clustering
<quote>
A node can be a RAM node or a disk node. RAM nodes keep their state only 
in memory (with the exception of the persistent contents of durable 
queues which are still stored safely on disc). Disk nodes keep state in 
memory and on disk. As RAM nodes don't have to write to disk as much as 
disk nodes, they can perform better. Because state is replicated across 
all nodes in the cluster, it is sufficient to have just one disk node 
within a cluster, to store the state of the cluster safely. Beware, 
however, that RabbitMQ will not stop you from creating a cluster with 
only RAM nodes. Should you do this, and suffer a power failure to the 
entire cluster, the entire state of the cluster, including all messages, 
will be lost.
</quote>


Matthias.


More information about the rabbitmq-discuss mailing list