When RabbitMQ on Kubernetes keeps partitioning or restarting, recover in order: freeze what keeps changing, read quorum state, cordon the suspect nodes, drain RabbitMQ before moving each pod, and stop publisher retry loops. This post gives the commands, how 4.3 and later behave differently, and how to prevent a repeat.
Recover in this order: freeze what keeps changing, read the quorum state, cordon the suspect Kubernetes nodes, drain RabbitMQ before you move each pod, and stop the retry loops. Find the root cause last. Green Kubernetes health checks do not mean the cluster is fine: a node can be Ready while RabbitMQ members cannot reach each other. The commands below come from the RabbitMQ 4.4 clustering guide, the upgrade guide and the Cluster Operator guide, read on 5 December 2026.
Why does RabbitMQ on Kubernetes keep partitioning or restarting?
Common patterns: a node-pool or VM change that moves pods, network drops between Kubernetes nodes, a hard pod kill during load, memory pressure that ends in an OOM kill, an operator that keeps re-applying a change, and clients that retry rejected publishes without a delay. Each one is survivable alone. Together they keep a cluster from settling.
What recovery looks like depends on the version:
RabbitMQ version
Metadata and replication
After a partition
4.3 and later
Khepri (Raft) only; quorum queues and streams are Raft too; partition handling strategies removed
The majority side keeps working. The minority side stops making progress until it rejoins, then catches up from the leader's log.
4.2 and earlier
Mnesia unless Khepri was enabled; cluster_partition_handling applies
Recovery follows the configured strategy, for example pause_minority. Use the guide for your version.
What do I do first when pods are restarting?
Work down this table and do not skip ahead. Each step protects the data the next one relies on.
Step
Command
Why
1. Freeze changes
kubectl label rabbitmqclusters NAME rabbitmq.com/pauseReconciliation=true
Only if the operator is re-applying changes while you work. Remove the label afterwards with pauseReconciliation-.
An unreachable node is missing from running nodes. The check warns if taking a node down would leave a queue without an online majority.
3. Cordon suspect nodes
kubectl cordon NODE
Stops new pods landing on the nodes you do not trust.
4. Drain RabbitMQ
rabbitmq-upgrade drain
Maintenance mode: the node stops serving clients and is not picked for new queue replicas.
5. Move one pod
Delete or reschedule the pod, then rabbitmq-upgrade revive
Wait for the member to rejoin and catch up before touching the next. A catching-up member cannot be elected leader.
6. Calm the clients
Backoff and dead-lettering in the application
See below.
How do I tell a Kubernetes node problem from a RabbitMQ problem?
Read the pods, the StatefulSet and the previous container logs before you touch RabbitMQ. On k8s a restart reason of OOMKilled points at memory, and several pods restarting at the same moment on one node points at the node, not the broker. The RabbitmqCluster resource shows whether all replicas are ready in its status columns.
kubectl get pods -o wide -l app.kubernetes.io/name=NAME
kubectl describe pod NAME-server-0
kubectl get events --sort-by=.lastTimestamp
kubectl -n NAMESPACE get rabbitmqcluster NAME
kubectl -n NAMESPACE get statefulset NAME-server
kubectl -n NAMESPACE logs NAME-server-0 -c rabbitmq --previous
kubectl -n NAMESPACE exec NAME-server-0 -- rabbitmq-diagnostics check_local_alarms
Match the timestamps of pod restarts against node events and against the first partition or alarm in the RabbitMQ log. If the node events come first, fix the node pool. If an alarm or a stuck queue comes first, work the RabbitMQ side.
Why does a restarted pod fail cluster formation?
With the Cluster Operator you do not normally configure peer discovery: the Kubernetes mechanism lists the pods through the Kubernetes API, and the cluster formation guide says requests that list pods are retried if they fail. When a restarted pod still cannot join, check two things first. Can the nodes reach each other over the pod network and DNS, and do all of them carry the same Erlang cookie? The guide names both as the first checks for cluster formation problems. A memory or disk alarm on one member is the other common blocker, so run check_local_alarms on every pod, not just the one that restarted.
Should I pause RabbitMQ operator reconciliation?
Only when the operator's own behaviour is part of the problem, for example while you move pods and it keeps restarting them. The documentation warns that a paused cluster is not watched: updates are ignored and a child object you delete by accident, such as the StatefulSet or a Service, is not recreated. It does not recommend the feature unless absolutely necessary. Set it, do the work, and remove the label.
Why do retry loops make recovery worse?
While a leader election runs, writes are rejected and a publisher confirm can arrive late or as a negative acknowledgement. The documentation says publishing applications can choose to republish later. Clients that republish every rejected message immediately multiply the traffic exactly when nodes are catching up.
Retry publishes with a capped exponential backoff and random jitter.
Cap in-flight messages with publisher confirms and a bounded buffer in the client.
On the consumer side, retry temporary failures a few times, then reject and dead-letter permanent ones. See RabbitMQ dead-letter queues.
How do I stop it coming back?
Run at least three members, spread across failure domains with pod anti-affinity, and give them a dedicated node pool with tolerations. The operator exposes both.
Create a PodDisruptionBudget so voluntary disruptions, such as node upgrades, cannot take down a majority.
Upgrade node pools with the drain and revive steps above, one node at a time.
Why does my RabbitMQ cluster on Kubernetes keep restarting or partitioning?
The usual causes are pods being moved or killed without draining RabbitMQ first, network drops between Kubernetes nodes, memory pressure that ends in an OOM kill, and an operator or client behaviour that keeps re-applying a change. Kubernetes can report every pod healthy while RabbitMQ members cannot reach each other.
Should I pause RabbitMQ operator reconciliation during an incident?
Only if the operator's own actions are part of the problem. Set the label rabbitmq.com/pauseReconciliation=true on the RabbitmqCluster, and remove it afterwards. While it is set the operator ignores updates and will not recreate a child object you delete by accident, which is why the documentation does not recommend it unless necessary.
How do I move a RabbitMQ pod without losing messages?
Put the node into maintenance mode with rabbitmq-upgrade drain, wait for it to stop serving clients, delete or move the pod, and run rabbitmq-upgrade revive when it is back. Check rabbitmq-diagnostics check_if_node_is_quorum_critical first, and move one pod at a time.
How does RabbitMQ 4.3 handle network partitions differently?
From 4.3.0 the only metadata store is Raft-based Khepri and the partition handling strategies were removed. The side with a majority keeps working, the minority side stops making progress until it rejoins, and rejoining members catch up from the leader's log. Earlier versions with Mnesia recover according to cluster_partition_handling.
Why do publisher retries make a RabbitMQ recovery worse?
During a leader election, publisher confirms can arrive late or as a negative acknowledgement. Clients that republish every rejected message at once multiply traffic while nodes are catching up. Retry with a capped, jittered backoff and dead-letter messages that fail permanently.
Whether you're troubleshooting a production incident, planning a migration, or want a second opinion on your architecture — our team is ready. No pitch, just answers.