4

I am setting up something like "rabbitMQ cluster" on machines in different locations, which is not good with RabbitMQ Clustering (since it is required to work with machines in a single location);

so I am looking at rabbitMQ Federation, but it is a directed network of nodes, if the first node is down, could it automatically move on to write to the next node?

My goal is able to have logs/data still flow through even tho some nodes are down, with machines in different locations

( can we use rabbitMQ Federation, to make it go both direction? For example, we have node1 and node2, and set node1 is both upstream and downstream of node2, node2 is also both upstream and downstream of node1. So this is just like a cluster, but can work with machines in different locations )

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
user3527917
  • 327
  • 2
  • 10
  • 22

1 Answers1

4

if the first node is down, could it automatically move on to write to the next node?

You could configure an DNS or load-balancer and configure the rules to redirect the traffic. For example if you configure a load-balancer you can use its IP to configure the upstream ip, in this way you can add or remove all nodes you want.

can we use rabbitMQ Federation, to make it go both direction?

Yes, but as you can read here:

You could have a loop messages

You can avoid a loop message using max_hops=1, please read here for more info

Your schema could be implemented also with the shovel, if you want just copy messages between the brokers.

The shovel plug-in supports multi brokers connection as:

[ "amqp://fred:secret@host1.domain/my_vhost"
  , "amqp://john:secret@host2.domain/my_vhost"
]

And if you can read here

If the host is omitted (not valid in a general AMQP URI), the shovel uses a direct connection to the broker in which it is running. This avoids using the network stack.

I hope it can be useful.

Gabriele Santomaggio
  • 21,656
  • 4
  • 52
  • 52