I have two DB servers and I am trying to make a Master-Slave replication for my PostgreSQL with TimescaleDB extension.
I went through this process:
[Both] Install PostgreSQL 12 on CentOS 7.
[Both] Initialize DB and install TimescaleDB. (followed official website tutorial)
[Both] Do all the
firewall-cmd,postgresql.conf, andpg_hba.confworks.[Master] Create initial database.
[Slave] stop PostgreSQL, remove everything in
/var/lib/pgsql/12/data, andpg_basebackupfrom Master.(Command I used:
pg_basebackup -h [MASTER_DB_IP] -D /var/lib/pgsql/12/data -U [REP_USER] -vP -W)[Slave] set
hot_standby = onand createrecovery.conf[Slave] start PostgreSQL to check replication works.
[Slave] This error occurs and cannot start PostgreSQL.
-- Subject: Unit postgresql-12.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-12.service has begun starting up.
Dec 02 17:53:40 localhost.localdomain postmaster[10439]: 2020-12-02 17:53:40.116 KST [10439] LOG: starting PostgreSQL 12.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red
Dec 02 17:53:40 localhost.localdomain postmaster[10439]: 2020-12-02 17:53:40.116 KST [10439] LOG: listening on IPv4 address "0.0.0.0", port 5432
Dec 02 17:53:40 localhost.localdomain postmaster[10439]: 2020-12-02 17:53:40.116 KST [10439] LOG: listening on IPv6 address "::", port 5432
Dec 02 17:53:40 localhost.localdomain postmaster[10439]: 2020-12-02 17:53:40.122 KST [10439] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Dec 02 17:53:40 localhost.localdomain postmaster[10439]: 2020-12-02 17:53:40.130 KST [10439] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
Dec 02 17:53:40 localhost.localdomain postmaster[10439]: 2020-12-02 17:53:40.142 KST [10439] LOG: redirecting log output to logging collector process
Dec 02 17:53:40 localhost.localdomain postmaster[10439]: 2020-12-02 17:53:40.142 KST [10439] HINT: Future log output will appear in directory "log".
Dec 02 17:53:42 localhost.localdomain systemd[1]: postgresql-12.service: main process exited, code=exited, status=1/FAILURE
Dec 02 17:53:42 localhost.localdomain systemd[1]: Failed to start PostgreSQL 12 database server.
As far as I know, this is the last step for replication. But PostgreSQL is not starting after all configuration.
Please ask me any detailed questions.
Thank you in advance.