Recently, our staging database environment was not available so we had to promote the DR database using the script below.
Expand|Select|Wrap|Line Numbers
- [root@DRPOSDB tmp]# su postgres
- bash-4.2$
- bash-4.2$
- bash-4.2$
- bash-4.2$
- bash-4.2$ /usr/pgsql-9.2/bin/pg_ctl -D /target_directory promote
- pg_ctl: PID file "/target_directory/postmaster.pid" does not exist
- Is server running?
- bash-4.2$
- bash-4.2$
- bash-4.2$ locate postmaster.pid
- /var/lib/pgsql/9.2/data/postmaster.pid
- bash-4.2$
- bash-4.2$
- bash-4.2$ /usr/pgsql-9.2/bin/pg_ctl -D /var/lib/pgsql/9.2/data promote
- server promoting
- bash-4.2$
- bash-4.2$
- bash-4.2$
- bash-4.2$
Now replication as stopped because DR was promoted from slave to master. Also, data has started coming to LIVE database.
How do we make replication to start again, i have not been able to see any documentation to do this.