Problem DataBase PostgreSQL Hight Availability Postgres HA Issues

Walter-Tscharf-Development
2 min readApr 26, 2022

This article is to summarize some problems and solutions in the context of PostgresSQL HA. In my setup, I’m using the database on a Kubernetes cluster.

1. Problem:

Stopping PostgreSQL…

Solution:

Most likely you have a wrong PostgreSQL replication manager version. Change the version by changing the docker image.

Instead of version 11.13.0-debian-10-r0 use a version 11.12.0-debian-10-r0. And try if the problem consists. For an overview of the available version use https://hub.docker.com/r/bitnami/postgresql-repmgr/tags .

2. Problem:

Waiting for primary node

Solution:

Probably your host setting for the connection is wrong. Therefore we can use the environment variable “REPMGR_NODE_NETWORK_NAME”. The value typically should look something like this:

db-postgresql-ha-postgresql-0.db-postgresql-ha-postgresql-headless.default.svc.cluster.local

Should look something like this:

3. Problem:

If you run into a problem of the following context.

The node name does not follow the required format.

Here is the solution:

The Enviroment Variable “REPMGR_NODE_NAME” is mission or set wrongly. Therefore we can set “pg-0” here. Mostly this is the correct name but double check if it is really our desired name.

Tip

if you are using RancherOS as your Kubernetes management system you can change the configuration and environment variables by switching to the cluster manager -> StatefulSets -> click on the “…-ha-postgresql” instance ->click on the three dots -> edit config. Here you can now edit the environment variables of a workload.

Helpful articles:

[1] https://github.com/bitnami/charts/issues/2378

[2] https://hub.docker.com/r/bitnami/postgresql-repmgr/tags

[3] https://github.com/bitnami/bitnami-docker-pgpool

--

--