diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index ad8f4b011354a79bd678d2a8a6ccae70f219b07a..351f05b681521ab4b5369013ae40c9e7ce4bcbe5 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -1,4 +1,4 @@ - + High Availability, Load Balancing, and Replication @@ -764,7 +764,7 @@ if (!triggered) PostgreSQL includes a simple streaming replication mechanism, which lets the standby server to stay more up-to-date than - file-based replication allows. The standby connects to the primary + file-based log shipping allows. The standby connects to the primary and the primary starts streaming WAL records from where the standby left off, and continues streaming them as they are generated, without waiting for the WAL file to be filled. So with streaming replication, @@ -805,20 +805,17 @@ if (!triggered) - Set up connections and authentication so that the standby server can - successfully connect to the pseudo replication database of - the primary server (see - ). Ensure that - and pg_hba.conf are - configured appropriately on the primary. + Set and authentication options + (see pg_hba.conf) so that the standby server can connect to + the pseudo replication database of the primary server (see + ). On systems that support the keepalive socket option, setting , and - helps you to find the - troubles with replication (e.g., the network outage or the failure of - the standby server) as soon as possible. + helps the master to notice + a broken connection promptly. @@ -827,13 +824,6 @@ if (!triggered) (see for details). - - - Enable WAL archiving in the primary server because we need to make a base - backup of it later (see and - for details). - - Start the PostgreSQL server on the primary. @@ -850,13 +840,12 @@ if (!triggered) - Set up WAL archiving, connections and authentication like the primary - server, because the standby server might work as a primary server after - failover. Ensure that your settings are consistent with the - future environment after the primary and the standby - server are interchanged by failover. If you're setting up the standby - server for e.g reporting purposes, with no plans to fail over to it, - configure the standby accordingly. + If you're setting up the standby server for high availability purposes, + set up WAL archiving, connections and authentication like the primary + server, because the standby server will work as a primary server after + failover. If you're setting up the standby server for e.g reporting + purposes, with no plans to fail over to it, configure the standby + accordingly. @@ -871,12 +860,25 @@ if (!triggered) Specifies whether to start the PostgreSQL server as - a standby. If this parameter is on, the streaming - replication is enabled and the standby server will try to connect - to the primary to receive and apply WAL records continuously. The - default is off, which allows only an archive recovery - without replication. So, streaming replication requires this - parameter to be explicitly set to on. + a standby. If this parameter is on, the server will + not end recovery when the end of archived WAL is reached, but + will keep trying to continue recovery using restore_command + and by connecting to the primary server as specified by + primary_conninfo setting. + + + + + restore_command (string) + restore_end_command (string) + + + In standby-mode, restore_command (and restore_end_command) is set to a + simple command or script like in PITR. pg_standby or similar tools + that wait for the next WAL file to arrive, cannot be used with + streaming replication, as the server handles retries and waiting + itself. Set restore_command as you would if you were + recovering using a Continuous archiving backup (see ). @@ -902,16 +904,22 @@ if (!triggered) the password needs to be set if the primary demands password authentication. + + This setting has no effect if standby_mode is off. + trigger_file (string) - Specifies a trigger file whose presence activates the standby. - If no trigger file is specified, the standby never exits + Specifies a trigger file whose presence ends recovery in the + standby. If no trigger file is specified, the standby never exits recovery. + + This setting has no effect if standby_mode is off. +