I have 2 postgresql servers. One is the primary and another one is the standby. I am trying to setup repmgr to do the switchover manually. Passwordless ssh have been setup for postgres ID on both servers.
I use this command "repmgr standby switchover --log-level=DEBUG --verbose". The standy database is able to promote to be the primary. For the previous primary database, it was shutdown. It was not able to bring up as standby by repmgr.
In a switchover the primary server is shutdown and restarted as a standby server after the newly promoted primary (former secondary) node has been started.
If the primary did not start, there must have been an issue since this is not the standard behavior for a switchover command.
Have you checked the Postgres log file for the previous primary? You should find the startup failure cause in the log.
Regards,
Fernando
El mié, 1 oct 2025 a la(s) 7:30 a.m., Chris Lee (clee.hk@gmail.com) escribió:
Hi Tayyab,
Thanks for your information . I also want to find out whether that is the default behavior, or I am not configuring repmgr correctly.
I have 2 postgresql servers. One is the primary and another one is the standby. I am trying to setup repmgr to do the switchover manually. Passwordless ssh have been setup for postgres ID on both servers.
I use this command "repmgr standby switchover --log-level=DEBUG --verbose". The standy database is able to promote to be the primary. For the previous primary database, it was shutdown. It was not able to bring up as standby by repmgr.
Does anyone encounter this issue before? Thanks a lot for any suggestions.
Here is my OS and DB versions:
OS version: CentOS Stream release 8 Postgres DB version: 15.12 rempmgr version: 5.5.0
Here is the repmgr conf files: >>>>> node_id=1 # Use 2 on standby node_name='primary' conninfo='host=centos804 user=repmgr dbname=repmgr password=xxx connect_timeout=15' use_primary_conninfo_password=true data_directory='/var/lib/pgsql/15/data' # Adjust for your setup pg_bindir='/usr/pgsql-15/bin' service_start_command = 'sudo systemctl start postgresql-15' service_stop_command = 'sudo systemctl stop postgresql-15' <<<<<
>>>>> node_id=2 # Use 2 on standby node_name='standby' conninfo='host=centos803 user=repmgr dbname=repmgr password=xxx connect_timeout=15' use_primary_conninfo_password=true data_directory='/var/lib/pgsql/15/data' # Adjust for your setup pg_bindir='/usr/pgsql-15/bin' service_start_command = 'sudo systemctl start postgresql-15' service_stop_command = 'sudo systemctl stop postgresql-15' <<<<<