From bb0fd944ae9e1d11190abf379ecaf7a03c45b978 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 2 Apr 2019 09:10:05 +0900 Subject: [PATCH] doc: update quickstart guide Improve sample PostgreSQL replication configuration, including links to the PostgreSQL documentation for each configuration item. Also set "max_replication_slots" to the same value as "max_wal_senders" to ensure the sample configuration will work regardless of whether replication slots are in use, though we do still encourage careful reading of the comments in the sample configuration and the documentation in general. --- doc/quickstart.sgml | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/doc/quickstart.sgml b/doc/quickstart.sgml index 356e850f..72a871c9 100644 --- a/doc/quickstart.sgml +++ b/doc/quickstart.sgml @@ -76,19 +76,25 @@ - # Enable replication connections; set this figure to at least one more + # Enable replication connections; set this value to at least one more # than the number of standbys which will connect to this server - # (note that repmgr will execute `pg_basebackup` in WAL streaming mode, - # which requires two free WAL senders) + # (note that repmgr will execute "pg_basebackup" in WAL streaming mode, + # which requires two free WAL senders). + # + # See: https://www.postgresql.org/docs/current/runtime-config-replication.html#GUC-MAX-WAL-SENDERS max_wal_senders = 10 - # Enable replication slots; set this figure to at least one more + # If using replication slots, set this value to at least one more # than the number of standbys which will connect to this server. # Note that repmgr will only make use of replication slots if - # "use_replication_slots" is set to "true" in repmgr.conf + # "use_replication_slots" is set to "true" in "repmgr.conf". + # (If you are not intending to use replication slots, this value + # can be set to "0"). + # + # See: https://www.postgresql.org/docs/current/runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS - max_replication_slots = 0 + max_replication_slots = 10 # Ensure WAL files contain enough information to enable read-only queries # on the standby. @@ -103,24 +109,31 @@ # Enable read-only queries on a standby # (Note: this will be ignored on a primary but we recommend including - # it anyway) + # it anyway, in case the primary later becomes a standby) + # + # See: https://www.postgresql.org/docs/current/runtime-config-replication.html#GUC-HOT-STANDBY hot_standby = on # Enable WAL file archiving + # + # See: https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-ARCHIVE-MODE + archive_mode = on - # Set archive command to a script or application that will safely store - # you WALs in a secure place. /bin/true is an example of a command that - # ignores archiving. Use something more sensible. + # Set archive command to a dummy command; this can later be changed without + # needing to restart the PostgreSQL instance. + # + # See: https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-ARCHIVE-COMMAND + archive_command = '/bin/true' Rather than editing these settings in the default postgresql.conf - file, create a separate file such as postgresql.replication.conf and + file, create a separate file such as postgresql.replication.conf and include it from the end of the main configuration file with: - include 'postgresql.replication.conf. + include 'postgresql.replication.conf'. @@ -129,7 +142,8 @@ wal_log_hints; for more details see . - See also the PostgreSQL configuration section in the repmgr configuaration guide. + See also the PostgreSQL configuration section in the + repmgr configuration guide.