Stefan D.
Stefan D.

Reputation: 387

RabbitMQ Cluster with Load Balancer

I need to sync tables between different databases. Therefore I want to setup a high availability RabbitMQ cluster. It's really important that no message get lost because it would result in an async table.

RabbitMQ Cluster with LB

As you can see here, this approach has a critical point of failure. If the load balancer isn't reachable for whatever reason the sender isn't able to send messages to the RabbitMQ queue.

Possible options would be:

  1. Add all the nodes to your application and loop through them until you found a working one.
  2. Install a software load balancer like HAProxy on all your webserver nodes to resolve to a working RabbitMQ node.

I didn't feel comfortable with both solutions. Maybe someone has a better idea or has some further reading for this specific topic?

I want to use RabbitMQ with php. Shouldn't be important to know for this question but maybe someone knows a PHP specific answer.

Upvotes: 0

Views: 1410

Answers (1)

Gabriele Santomaggio
Gabriele Santomaggio

Reputation: 22682

This is a common problem.

If the load-balancer can fail in your scenario, you have to implement the HA behavior to the client side.

Most of RabbitMQ clients doesn't implement the HA. For example this client implements the HA client side.

If you are afraid about the load-balancer fail, you could also configure the load-balancer in HA .

I'd put the attention to configure the load-balancer in HA.

BTW your question is quite generic, hope it helps

Upvotes: 1

Related Questions