Hi all,
We are testing out exchange federation between a 3-node Rabbit cluster (behind a haproxy load balancer) and 3 standalone nodes. We have noticed slightly unexpected behaviour regarding the federation connections between all the nodes. That is, the federation user connects seemingly successfully, and then immediately closes the connection. Rabbit logs look like:
=INFO REPORT==== 15-Nov-2017::13:38:42 ===
accepting AMQP connection <0.11624.18> (<ip1>:7927 -> <ip2>:5671)
<other federation activity elided>
=INFO REPORT==== 15-Nov-2017::13:38:42 ===
connection <0.11624.18> (<ip1>:7927 -> <ip2>:5671): user 'federation' authenticated and granted access to vhost '/'
<other federation activity elided>
=INFO REPORT==== 15-Nov-2017::13:38:42 ===
closing AMQP connection <0.11624.18> (<ip1>:7927 -> <ip2>:5671, vhost: '/', user: 'federation')
There are many logs like this, every second (ie, lots of connections are being created and closed all the time), on all nodes - cluster and standalone. SASL logs are clean.
We're trying to federate all our exchanges, with a few exceptions - around 100 exchanges in all. Regex config below.
Interestingly, the admin UI indicates that federation is running succesfully - the Federation Status page shows all green on both the cluster and standalone nodes. The main issue this appears to cause is excessive CPU usage on the servers, likely due to establishing many SSL connections.
I guess our main question is - would this be considered normal? Our understanding was that federation links would be long-running, similar to our application connections. We're also assuming that federating 100 exchanges is a reasonable number?
Kind regards,
Andrew
Some more details in case they're useful.
- RabbitMQ v 3.6.11
- Erlang/OTP 20 [erts-9.0.2] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:64] [hipe] [kernel-poll:true]
- SLES 12, running as a systemd service
Setup on the standalone nodes to federate upstream to the cluster:
rabbitmqctl set_policy federation-policy '^((?!(monitoring.*))(?!(federation.*))(?!(amq.*))((?!dead-letter).)*$)' '{"federation-upstream":"mqcluster"}' --apply-to exchanges
rabbitmqctl set_parameter federation-upstream mqcluster '{"ack-mode":"on-confirm","trust-user-id":false,"uri":"amqps://user@pass@hostname:5671?cacertfile=/etc/rabbitmq/ssl/rabbit.cacrt&certfile=/etc/rabbitmq/ssl/rabbit.crt&keyfile=/etc/rabbitmq/ssl/rabbit.key&verify=verify_peer&fail_if_no_peer_cert=true"}'
Setup on the cluster to federate to the 3x individual nodes:
rabbitmqctl set_policy federation-policy '^((?!(monitoring.*))(?!(federation.*))(?!(amq.*))((?!dead-letter).)*$)' '{"federation-upstream-set":"all"}' --apply-to exchanges
(and then we configure the three standalone rabbit nodes as federation-upstreams)