在主库创建物理复制槽:
SELECT * FROM pg_create_physical_replication_slot('slot_s1');
在备库测试:
[postgres@db223 pg_wal]$ pg_receivewal -U postgres -D /home/postgres/pgarch/ -S test_slot -v
pg_receivewal: starting log streaming at 11C/10000000 (timeline 8)
pg_receivewal: error: could not send replication command "START_REPLICATION": ERROR: replication slot "test_slot" does not exist
pg_receivewal: disconnected; waiting 5 seconds to try again
需要指定 -h db206
[postgres@db223 pgarch]$ pg_receivewal -h db206 -U postgres -D /home/postgres/pgarch/ -S test_slot -v