Postgres FATAL: hot standby is not possible because wal_level was not set to "replica" or higher on the master server

Viewed 2645

I am configuring postgres 9.6 on Linux two node (1 master and other is slave) https://www.howtoforge.com/tutorial/how-to-install-and-configure-master-slave-replication-with-postgresql-96-on-centos-7/

did all configuration as per note above, master node is running after configuration from note,

but after slave configuration form given note when I starting slave node getting below message in logs on slave side:

< 2020-03-17 01:12:07.408 +04 > LOG:  database system was interrupted while in recovery at log time 2020-03-17 00:37:30 +04
< 2020-03-17 01:12:07.408 +04 > HINT:  If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target.
< 2020-03-17 01:12:07.420 +04 > LOG:  entering standby mode
< 2020-03-17 01:12:07.422 +04 > WARNING:  WAL was generated with wal_level=minimal, data may be missing
< 2020-03-17 01:12:07.422 +04 > HINT:  This happens if you temporarily set wal_level=minimal without taking a new base backup.
< 2020-03-17 01:12:07.422 +04 > FATAL:  hot standby is not possible because wal_level was not set to "replica" or higher on the master server
< 2020-03-17 01:12:07.422 +04 > HINT:  Either set wal_level to "replica" on the master, or turn off hot_standby here.
< 2020-03-17 01:12:07.423 +04 > LOG:  startup process (PID 20755) exited with exit code 1
< 2020-03-17 01:12:07.423 +04 > LOG:  aborting startup due to startup process failure
< 2020-03-17 01:12:07.425 +04 > LOG:  database system is shut down

quite new with postgres and wondering if I missed something or note which I follow is missing something.

Did some google but unfortunately couldn't find anything.

1 Answers

wal_level had to be set to replica or higher at the time you took the base backup. It looks like you changed wal_level to replica too late. Throw away your old replica and run pg_basebackup again.

Why are you using 9.6? If you are just setting things up for the first time, you should be using the latest stable version, 12.

Related