From 98c4eb002a4edb744ca009a273826fb3d26f4554 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 28 Jan 2016 11:43:42 +0900 Subject: [PATCH] README: add replication slot example --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 59959b03..0b604673 100644 --- a/README.md +++ b/README.md @@ -542,6 +542,23 @@ When cloning a standby, `repmgr` will automatically generate an appropriate slot name, which is stored in the `repl_nodes` table, and create the slot on the master: + repmgr=# SELECT * from repl_nodes ORDER BY id; + id | type | upstream_node_id | cluster | name | conninfo | slot_name | priority | active + ----+---------+------------------+---------+-------+------------------------------------------+---------------+----------+-------- + 1 | master | | test | node1 | host=localhost dbname=repmgr user=repmgr | repmgr_slot_1 | 100 | t + 2 | standby | 1 | test | node2 | host=localhost dbname=repmgr user=repmgr | repmgr_slot_2 | 100 | t + 3 | standby | 1 | test | node3 | host=localhost dbname=repmgr user=repmgr | repmgr_slot_3 | 100 | t + + repmgr=# SELECT * FROM pg_replication_slots ; + slot_name | plugin | slot_type | datoid | database | active | active_pid | xmin | catalog_xmin | restart_lsn + ---------------+--------+-----------+--------+----------+--------+------------+------+--------------+------------- + repmgr_slot_3 | | physical | | | t | 26060 | | | 0/50028F0 + repmgr_slot_2 | | physical | | | t | 26079 | | | 0/50028F0 + (2 rows) + +Note that a slot name will be created by default for the master but not +actually used unless the master is converted to a standby using e.g. +`repmgr standby switchover`. Be aware that when initially cloning a standby, you will need to ensure that all required WAL files remain available while the cloning is taking