RabbitMQ Federation with Sensu


#1

I’d like to setup two rabbitmq instances (eventually clusters) in different data centers. The rabbitmq docs recommend federation over a WAN link, however I appear to be misunderstanding how this works with Sensu. I was hoping someone could clear up some questions about how this works:

  1. If I had two rabbitmq instances using an 2-way exchange federation (as outlined here: https://www.rabbitmq.com/federation.html) on each instance, I would expect that a client connected to either rabbitmq instance would work correctly with Sensu (as the message would be copied to the other data center) - is this correct?
  2. What exchange name is used by Sensu? Previous git commits seem to suggest the default (unnamed) exchange was used at one point, but was changed (to what?). In addition, what queue name is used by Sensu?
  3. Is a federated queue recommended for Sensu over a federated exchange? Is there an advantage/disadvantage to each?
  4. Has anyone actually gotten a federation (of any kind) with rabbitmq and sensu working? If so, can you outline the steps you took to get there (even better, can you list the rabbitmqctl commands or web gui steps?)
    Apologies if any of these questions do not make sense - attempting to learn rabbitmq as I go along. Any help would be greatly appreciated. Thanks!

#2

We are using federation for multi-datacenter replication.

I’m not sure what you mean by 2-way exchange federation, but the federation in general flows in one direction. We have one main cluster in EC2 which runs all the Sensu “server” components (dashboard, server, api). Then each datacenter has a machine which federates with the main cluster as their upstream. For each datacenter, the central cluster has an upstream of the remote datacenter, but that federation link only replicates the keepalives and results exchanges. We set that up like this (only needs to be done once in the cluster):

rabbitmqctl set_policy -p sensu --apply-to exchanges sensu-result "^(results|keepalives)" '{"federation-upstream-set":"all"}'

``

From the snippet, obviously we’re using exchanges. I’m not sure that it’s the “recommended” way, but it works well enough for us so far.

I’ve been working on a blog post on how we have it setup, but it’s been slow going.

···

On Monday, August 4, 2014 8:23:12 AM UTC-5, Ryan Van Antwerp wrote:

I’d like to setup two rabbitmq instances (eventually clusters) in different data centers. The rabbitmq docs recommend federation over a WAN link, however I appear to be misunderstanding how this works with Sensu. I was hoping someone could clear up some questions about how this works:

  1. If I had two rabbitmq instances using an 2-way exchange federation (as outlined here: https://www.rabbitmq.com/federation.html) on each instance, I would expect that a client connected to either rabbitmq instance would work correctly with Sensu (as the message would be copied to the other data center) - is this correct?
  2. What exchange name is used by Sensu? Previous git commits seem to suggest the default (unnamed) exchange was used at one point, but was changed (to what?). In addition, what queue name is used by Sensu?
  3. Is a federated queue recommended for Sensu over a federated exchange? Is there an advantage/disadvantage to each?
  4. Has anyone actually gotten a federation (of any kind) with rabbitmq and sensu working? If so, can you outline the steps you took to get there (even better, can you list the rabbitmqctl commands or web gui steps?)
    Apologies if any of these questions do not make sense - attempting to learn rabbitmq as I go along. Any help would be greatly appreciated. Thanks!