raven-king
raven-king

Reputation: 1550

RabbitMq queue being removed when node stopped

I have created two RabbitMQ nodes (say A and B) and I have cluster them. I have then done the following in the management UI :

(note that node A is intially the master)

  1. On node A I created a queue (durable=true, auto-delete=false) and can see it shared on node B
  2. Stopped node A, I can still see it on B (great)
  3. Started node A again
  4. Stopped node B, the queue has been removed from node A

This seems strange as node B was not even involved in the created of the queue

I then tried the same from node B :

  1. On node B I created a queue (durable=true, auto-delete=false) and can see it shared on node A
  2. Stopped node A, I can still see it on B (great)
  3. Started node A again
  4. Stopped node B, the queue has been removed from node A

The situation I am looking for is that no matter which node is stopped that the queue is still available on the other node.

Upvotes: 0

Views: 293

Answers (1)

raven-king
raven-king

Reputation: 1550

I just noticed that the policies I setup have been removed from each node... no idea why. Just in case somebody else is having the same issue you can create policies using (e.g.)

rabbitmqctl set_policy ha-all "^com\.mydomain\." '{"ha-mode":"all","ha-sync-mode":"automatic"}'

It's immediately noticeable in the RabbitMQ Web UI as you can see the policy on the queue definition (in this case "ha-all").

See https://www.rabbitmq.com/ha.html for creating and,

See Policy Management section http://www.rabbitmq.com/man/rabbitmqctl.1.man.html for administration

Upvotes: 1

Related Questions