We had the following setup in place
- db01 -> Master Postgres 9.3
- db02 -> Slave Postgres 9.3
Master data got corrupted (logically) and as soon as it was identified we shutdown the server. Dev team were able to check the Slave and the data there were still intact.
We decided then to promote slave to master, we went to slave and try to run pg_ctl promote
, there were no errors on the output, however the data was still on read mode. We tried to run the command once more and after restarting the DB we couldn’t access it anymore, we had the following error while trying to run
“psql” -> psql: FATAL: the database system is starting up .
At this stage we are not sure if the slave has actually became master, as we can’t psql on it. By running ps -ef
we have the following output
postgres 4649 4647 0 19:15 ? 00:00:00 postgres: logger
process postgres 4650 4647
3 19:15 ? 00:05:19 postgres: startup process recovering
0000000100000EF200000019
Perhaps the questions are:
- What could be the right procedure to promote Slave to Master on this
situation? - How can we avoid the issue “psql: FATAL: the database system is
starting up .”
We have on postgresql.conf
the following:
hot_standby = on
commented and archive_mode = off
Best