How to resolve the RabbitMQ error log displaying "Error while waiting for Mnesia tables: {timeout_waiting_for_tables, [rabbit_user, rabbit_user_permission, ...]}"?

RabbitMQ is HA architecture

Rabbitmq log

RabbitMQ internally uses the Mnesia database to synchronize cluster state. When all nodes in an HA cluster have been shut down, RabbitMQ stipulates that “the last node shut down must be the first to start.”

Therefore, in your current situation: the Pod does not believe it is the last node to be shut down, hence the error. The solution is as follows.

  1. Shutting down RabbitMQ using the scale command:

    kubectl -n ensaas-db scale sts rabbitmq-rabbitmq-ha --replicas=0

  2. Deleting the RabbitMQ PVC (the HA architecture will have 3 PVCs):

    kubectl -n ensaas-db delete pvc $rabbitmq-pvc-name

  3. Restarting RabbitMQ using the scale command:

    kubectl -n ensaas-db scale sts rabbitmq-rabbitmq-ha --replicas=3