1- <!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.64 2010/04/28 16:10:40 heikki Exp $ -->
1+ <!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.65 2010/04/29 21:36:18 tgl Exp $ -->
22
33<chapter id="high-availability">
44 <title>High Availability, Load Balancing, and Replication</title>
@@ -1127,7 +1127,8 @@ if (!triggered)
11271127
11281128 <para>
11291129 Hot Standby is the term used to describe the ability to connect to
1130- the server and run queries while the server is in archive recovery. This
1130+ the server and run read-only queries while the server is in archive
1131+ recovery. This
11311132 is useful for both log shipping replication and for restoring a backup
11321133 to an exact state with great precision.
11331134 The term Hot Standby also refers to the ability of the server to move
@@ -1137,7 +1138,7 @@ if (!triggered)
11371138
11381139 <para>
11391140 Running queries in recovery mode is similar to normal query operation,
1140- though there are a several usage and administrative differences
1141+ though there are several usage and administrative differences
11411142 noted below.
11421143 </para>
11431144
@@ -1573,14 +1574,15 @@ if (!triggered)
15731574 <title>Administrator's Overview</title>
15741575
15751576 <para>
1576- If there is a <filename>recovery.conf</> file present, the server will start
1577- in Hot Standby mode by default, though <varname>recovery_connections</> can
1578- be disabled via <filename>postgresql.conf</>. The server might take
1579- some time to enable recovery connections since the server must first complete
1577+ If <varname>hot_standby</> is turned <literal>on</> in
1578+ <filename>postgresql.conf</> and there is a <filename>recovery.conf</>
1579+ file present, the server will run in Hot Standby mode.
1580+ However, it may take some time for Hot Standby connections to be allowed,
1581+ because the server will not accept connections until it has completed
15801582 sufficient recovery to provide a consistent state against which queries
1581- can run before enabling read only connections . During this period,
1583+ can run. During this period,
15821584 clients that attempt to connect will be refused with an error message.
1583- To confirm the server has come up, either loop retrying to connect from
1585+ To confirm the server has come up, either loop trying to connect from
15841586 the application, or look for these messages in the server logs:
15851587
15861588<programlisting>
@@ -1592,12 +1594,11 @@ LOG: consistent recovery state reached
15921594LOG: database system is ready to accept read only connections
15931595</programlisting>
15941596
1595- Consistency information is recorded once per checkpoint on the primary, as long
1596- as <varname>wal_level</> is set to <literal>hot_standby</> on the primary. It is not possible
1597- to enable recovery connections on the standby when reading WAL written during the
1598- period that <varname>wal_level</> was not set to <literal>hot_standby</> on the primary.
1599- Reaching a consistent state can also be delayed in the presence
1600- of both of these conditions:
1597+ Consistency information is recorded once per checkpoint on the primary.
1598+ It is not possible to enable hot standby when reading WAL
1599+ written during a period when <varname>wal_level</> was not set to
1600+ <literal>hot_standby</> on the primary. Reaching a consistent state can
1601+ also be delayed in the presence of both of these conditions:
16011602
16021603 <itemizedlist>
16031604 <listitem>
@@ -1622,10 +1623,9 @@ LOG: database system is ready to accept read only connections
16221623 if they have been changed on the primary. For these parameters,
16231624 the value on the standby must
16241625 be equal to or greater than the value on the primary. If these parameters
1625- are not set high enough then the standby will not be able to process
1626- recovering transactions properly. If these values are set too low
1627- the server will halt. Higher values can then be supplied and the server
1628- restarted to begin recovery again. The parameters are:
1626+ are not set high enough then the standby will refuse to start.
1627+ Higher values can then be supplied and the server
1628+ restarted to begin recovery again. These parameters are:
16291629
16301630 <itemizedlist>
16311631 <listitem>
@@ -1648,7 +1648,8 @@ LOG: database system is ready to accept read only connections
16481648
16491649 <para>
16501650 It is important that the administrator consider the appropriate setting
1651- of <varname>max_standby_delay</>, set in <filename>postgresql.conf</>.
1651+ of <varname>max_standby_delay</>,
1652+ which can be set in <filename>postgresql.conf</>.
16521653 There is no optimal setting, so it should be set according to business
16531654 priorities. For example if the server is primarily tasked as a High
16541655 Availability server, then you may wish to lower
@@ -1657,7 +1658,7 @@ LOG: database system is ready to accept read only connections
16571658 server for decision support queries then it might be acceptable to set this
16581659 to a value of many hours (in seconds). It is also possible to set
16591660 <varname>max_standby_delay</> to -1 which means wait forever for queries
1660- to complete, if there are conflicts ; this will be useful when performing
1661+ to complete; this will be useful when performing
16611662 an archive recovery from a backup.
16621663 </para>
16631664
@@ -1668,10 +1669,8 @@ LOG: database system is ready to accept read only connections
16681669 all users are read-only; no changes occur to the data values
16691670 themselves. Users will still write large sort temporary files and
16701671 re-generate relcache info files, so no part of the database
1671- is truly read-only during hot standby mode. There is no restriction
1672- on the use of set returning functions, or other users of
1673- <function>tuplestore</>/<function>tuplesort</>
1674- code. Note also that writes to remote databases will still be possible,
1672+ is truly read-only during hot standby mode.
1673+ Note also that writes to remote databases will still be possible,
16751674 even though the transaction is read-only locally.
16761675 </para>
16771676
@@ -1837,20 +1836,22 @@ LOG: database system is ready to accept read only connections
18371836 <title>Hot Standby Parameter Reference</title>
18381837
18391838 <para>
1840- Various parameters have been mentioned above in <xref linkend="hot-standby-admin">
1839+ Various parameters have been mentioned above in
1840+ <xref linkend="hot-standby-admin">
18411841 and <xref linkend="hot-standby-conflict">.
18421842 </para>
18431843
18441844 <para>
1845- On the primary, parameters <varname>wal_level</ > and
1846- <varname>vacuum_defer_cleanup_age</ > can be used.
1847- <varname>max_standby_delay</ > has no effect if set on the primary.
1845+ On the primary, parameters <xref linkend="guc-wal-level" > and
1846+ <xref linkend="guc-vacuum-defer-cleanup-age" > can be used.
1847+ <xref linkend="guc-max-standby-delay" > has no effect if set on the primary.
18481848 </para>
18491849
18501850 <para>
1851- On the standby, parameters <varname>recovery_connections</> and
1852- <varname>max_standby_delay</> can be used.
1853- <varname>vacuum_defer_cleanup_age</> has no effect during recovery.
1851+ On the standby, parameters <xref linkend="guc-hot-standby"> and
1852+ <xref linkend="guc-max-standby-delay"> can be used.
1853+ <xref linkend="guc-vacuum-defer-cleanup-age"> has no effect during
1854+ recovery.
18541855 </para>
18551856 </sect2>
18561857
@@ -1880,7 +1881,7 @@ LOG: database system is ready to accept read only connections
18801881 </listitem>
18811882 <listitem>
18821883 <para>
1883- Valid starting points for recovery connections are generated at each
1884+ Valid starting points for standby queries are generated at each
18841885 checkpoint on the master. If the standby is shut down while the master
18851886 is in a shutdown state, it might not be possible to re-enter Hot Standby
18861887 until the primary is started up, so that it generates further starting
@@ -1901,7 +1902,7 @@ LOG: database system is ready to accept read only connections
19011902 that normally take <literal>AccessExclusiveLocks</>, or you plan on having one
19021903 large transaction that takes many <literal>AccessExclusiveLocks</>, you are
19031904 advised to select a larger value of <varname>max_locks_per_transaction</>,
1904- up to, but never more than twice the value of the parameter setting on
1905+ perhaps as much as twice the value of the parameter on
19051906 the primary server. You need not consider this at all if
19061907 your setting of <varname>max_prepared_transactions</> is <literal>0</>.
19071908 </para>
0 commit comments