postgresqlreplication
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
postgresqlreplication [2021/08/31 11:25] – [Check Replication Progress] z0hpvk | postgresqlreplication [2025/03/08 22:24] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 44: | Line 44: | ||
pg_basebackup -D < | pg_basebackup -D < | ||
+ | -D Data Directory | ||
-v Verbose | -v Verbose | ||
-P Progress Reporting | -P Progress Reporting | ||
Line 51: | Line 52: | ||
</ | </ | ||
- | Once the copy has completed, you will see the following message | + | Once the copy has completed, you will see the following message: \\ |
< | < | ||
pg_basebackup: | pg_basebackup: | ||
Line 60: | Line 61: | ||
< | < | ||
hot_standby = on | hot_standby = on | ||
+ | </ | ||
+ | |||
+ | ==== Create a Replication Slot on the Primary ==== | ||
+ | < | ||
+ | SELECT * FROM pg_create_physical_replication_slot(' | ||
</ | </ | ||
Line 66: | Line 72: | ||
standby_mode = on | standby_mode = on | ||
primary_conninfo = ' | primary_conninfo = ' | ||
+ | primary_slot_name = ' | ||
</ | </ | ||
Line 76: | Line 83: | ||
==== Check Replication Progress ==== | ==== Check Replication Progress ==== | ||
< | < | ||
+ | cd $HOME/ | ||
ls -lrt $(ps -ef | grep postgres | grep recovering | grep -v grep | awk {' | ls -lrt $(ps -ef | grep postgres | grep recovering | grep -v grep | awk {' | ||
Line 88: | Line 96: | ||
select TXID_CURRENT_SNAPSHOT(); | select TXID_CURRENT_SNAPSHOT(); | ||
select * from PG_LAST_XACT_REPLAY_TIMESTAMP(); | select * from PG_LAST_XACT_REPLAY_TIMESTAMP(); | ||
+ | select pg_wal_replay_pause(); | ||
+ | select pg_wal_replay_resume(); | ||
-- Note some function names changed in PostgreSQL 10 | -- Note some function names changed in PostgreSQL 10 |
postgresqlreplication.1630409109.txt.gz · Last modified: 2025/03/08 22:23 (external edit)