I want to configure a cluster with the following expected behavior:
- Сluster must be HA ( 3 nodes at least).
- I have queues in which it is important to maintain processing order. The consumer always reads this queue in a single thread. If he took the message, then we consider our task completed.
- I don't need load balancing - it is important for me to maintain the order of messages.
- I want to avoid split-brain.
- If we have 3 nodes, then if 1 of the nodes fails, the cluster should continue to work.
I tried following configurations:
- master + slave + slave with replication.
It works. But does not solve the problem of split brain
- master + slave + slave + Pinger
As far as I understand, this does not give a 100% guarantee of detecting network problems. We can also get split-brain.
- 3 pairs of live/backup nodes.
This is solved split brain problem but how can we avoid the following situation:
- Producer send message to group A in queue (where important to maintain processing order)
- Group A crashed ( 1/3 of all nodes 2/6)
- The message stored in the journal of group A
- Cluster continue to work;
- Producer send message to group B in queue (where important to maintain processing order)
- Consumer got this message first; We did not support the required message order.
How should I build a cluster to solve these problems?