Skip to content

Commit

Permalink
Traduction de high-availability, installation et postgresql-fdw.
Browse files Browse the repository at this point in the history
  • Loading branch information
rjuju authored and gleu committed Oct 13, 2014
1 parent 02648be commit 75b0e44
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 108 deletions.
130 changes: 69 additions & 61 deletions postgresql/high-availability.xml
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,10 @@ protocol to make nodes agree on a serializable transactional order.
standby ; c'est-à-dire, créez un rôle et mettez en place une ou des entrées appropriées dans
<filename>pg_hba.conf</filename> avec le champ database positionné à
<literal>replication</literal>. Vérifiez aussi que <varname>max_wal_senders</varname> est positionné
à une valeur suffisamment grande dans le fichier de configuration du serveur primaire. If replication slots will be used,
ensure that <varname>max_replication_slots</varname> is set sufficiently
high as well.
à une valeur suffisamment grande dans le fichier de configuration du serveur primaire.
Si des slots de réplication seront utilisés, il faut s'assurer que
<varname>max_replication_slots</varname> est également positionné à une
valeur suffisamment grande.
</para>

<para>
Expand Down Expand Up @@ -811,14 +812,17 @@ archive_cleanup_command = 'pg_archivecleanup /path/to/archive %r'

<para>
Si vous utilisez la streaming replication sans archivage en continu des fichiers,
the server might recycle old WAL segments before the standby
has received them. If this occurs, the standby will need to be
reinitialized from a new base backup. You can avoid this by setting
<varname>wal_keep_segments</varname> to a value large enough to ensure that
WAL segments are not recycled too early, or by configuring a replication
slot for the standby. If you set up a WAL archive that's accessible from
the standby, these solutions are not required, since the standby can
always use the archive to catch up provided it retains enough segments.
le serveur pourrait recycler de vieux journaux de transactions avant que le
serveur ne les ait reçus. Si cela arrive, le serveur en standby devra être
recréé d'une nouvelle sauvegarde de l'instance. Vous pouvez éviter cela en
positionnant <varname>wal_keep_segments</varname> à une valeur suffisamment
grande pour s'assurer que les journaux de transactions ne sont pas recyclés
trop tôt, ou en configurant un slot de réplication pour le serveur en
standby. Si un archivage des journaux de transactions est en place, et que
les fichiers archivés sont disponibles depuis le serveur en standby, cette
solution n'est pas nécessaire, puisque le serveur en standby peut toujours
utiliser les fichiers archivés pour rattraper son retard, sous réserve que
suffisamment de fichiers soient conservés.
</para>

<para>
Expand Down Expand Up @@ -937,58 +941,60 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
</sect2>

<sect2 id="streaming-replication-slots">
<title>Replication Slots</title>
<title>Slots de réplication</title>
<indexterm>
<primary>replication slot</primary>
<secondary>streaming replication</secondary>
<primary>slot de réplication</primary>
<secondary>réplication en flux</secondary>
</indexterm>
<para>
Replication slots provide an automated way to ensure that the master does
not remove WAL segments until they have been received by all standbys,
and that the master does not remove rows which could cause a
<link linkend="hot-standby-conflict">recovery conflict</link> even when the
standby is disconnected.
</para>
<para>
In lieu of using replication slots, it is possible to prevent the removal
of old WAL segments using <xref linkend="guc-wal-keep-segments"/>, or by
storing the segments in an archive using
<xref linkend="guc-archive-command"/>.
However, these methods often result in retaining more WAL segments than
required, whereas replication slots retain only the number of segments
known to be needed. An advantage of these methods is that they bound
the space requirement for <literal>pg_xlog</literal>; there is currently no way
to do this using replication slots.
</para>
<para>
Similarly, <xref linkend="guc-hot-standby-feedback"/>
and <xref linkend="guc-vacuum-defer-cleanup-age"/> provide protection against
relevant rows being removed by vacuum, but the former provides no
protection during any time period when the standby is not connected,
and the latter often needs to be set to a high value to provide adequate
protection. Replication slots overcome these disadvantages.
Les slots de réplication fournissent une manière automatisée de s'assurer
que le maître ne supprime pas les journaux de transactions avant qu'ils
n'aient été reçus par tous les serveurs en standby, et que le serveur
maître ne supprime pas des lignes qui pourraient causer un
<link linkend="hot-standby-conflict">conflit de restauration</link> même si
le serveur en standby est déconnecté.
</para>
<para>
Au lieu d'utiliser des slots de réplication, il est possible d'empêcher la
suppression des anciens journaux de transations en utilisant
<xref linkend="guc-wal-keep-segments"/>, ou en les stockant dans un
répertoire d'archive en utilisant <xref linkend="guc-archive-command"/>.
Cependant, ces méthodes ont souvent pour résultat le stockage de plus de
journaux de transactions que nécessaire, alors que les slots de réplication
ne conservent que le nombre nécessaire de journaux de transactions. Un
avantage de ces méthodes est qu'elles limitent l'espace requis pour
<literal>pg_xlog</literal>&nbsp;; il n'y a pour le moment aucun moyen d'en
faire de même en utilisant les slots de réplication.
</para>
<para>
De la même manière, <xref linkend="guc-hot-standby-feedback"/>
et <xref linkend="guc-vacuum-defer-cleanup-age"/> fournissent des
protections contre la suppression de lignes utiles par vacuum, mais le
premier paramètre n'offre aucune protection durant la période pendant
laquelle le serveur de standby n'est pas connecté, et le second nécessite
souvent d'être positionné à une grande valeur pour fournir une protection
adéquate. Les slots de réplication surmontent ces désavantages.
</para>
<sect3 id="streaming-replication-slots-manipulation">
<title>Querying and manipulating replication slots</title>
<title>Requêter et manipuler des slots de réplication</title>
<para>
Each replication slot has a name, which can contain lower-case letters,
numbers, and the underscore character.
Chaque slot de réplication à un nom, qui peut contenir des lettres en
minuscule, des nombres ou un tiret bas.
</para>
<para>
Existing replication slots and their state can be seen in the
<link linkend="catalog-pg-replication-slots"><structname>pg_replication_slots</structname></link>
view.
Les slots de réplication existants et leur états peuvent être vus dans la vue
<linklinkend="catalog-pg-replication-slots"><structname>pg_replication_slots</structname></link>.
</para>
<para>
Slots can be created and dropped either via the streaming replication
protocol (see <xref linkend="protocol-replication"/>) or via SQL
functions (see <xref linkend="functions-replication"/>).
Les slots de réplication peuvent être créés et supprimés soit via le
protocole de réplication en flux (voir <xref linkend="protocol-replication"/>)
soit via des fonctions SQL (voir <xref linkend="functions-replication"/>).
</para>
</sect3>
<sect3 id="streaming-replication-slots-config">
<title>Configuration Example</title>
<title>Exemple de configuration</title>
<para>
You can create a replication slot like this:
Il est possible de créer un slot de réplication ainsi&nbsp;:
<programlisting>
postgres=# SELECT * FROM pg_create_physical_replication_slot('node_a_slot');
slot_name | xlog_position
Expand All @@ -1001,9 +1007,10 @@ postgres=# SELECT * FROM pg_replication_slots;
node_a_slot | physical | | | f | |
(1 row)
</programlisting>
To configure the standby to use this slot, <varname>primary_slot_name</varname>
should be configured in the standby's <filename>recovery.conf</filename>.
Here is a simple example:
Pour configurer le serveur en standby pour utiliser ce slot,
<varname>primary_slot_name</varname> devrait être configuré dans le
<filename>recovery.conf</filename> de l'esclave.
Voilà un exemple simple&nbsp;:
<programlisting>
standby_mode = 'on'
primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
Expand Down Expand Up @@ -1999,15 +2006,16 @@ if (!triggered)
en une fragmentation non désirée de la table. Néanmoins, cette situation
ne sera pas meilleure si les requêtes du serveur en attente s'exécutaient
directement sur le serveur maître. Vous avez toujours le bénéfice de
l'exécution sur un serveur distant.
If standby servers connect and disconnect frequently, you
might want to make adjustments to handle the period when
<varname>hot_standby_feedback</varname> feedback is not being provided.
For example, consider increasing <varname>max_standby_archive_delay</varname>
so that queries are not rapidly canceled by conflicts in WAL archive
files during disconnected periods. You should also consider increasing
<varname>max_standby_streaming_delay</varname> to avoid rapid cancellations
by newly-arrived streaming WAL entries after reconnection.
l'exécution sur un serveur distant. Si des serveurs en standby se
connectent et se déconnectent fréquemment, vous pourriez vouloir faire des
ajustements pour gérer la période durant laquelle <varname>hot_standby_feedback</varname>
n'est pas renvoyé. Par exemple, vous pouvez considérer l'augmentation de
<varname>max_standby_archive_delay</varname> pour que les requêtes ne
soient pas annulées rapidement par des conflits avec le journal de transactions
d'archive durant les périodes de déconnexion. Vous pouvez également
considérer l'augmentation de <varname>max_standby_streaming_delay</varname>
pour éviter des annulations rapides par les nouvelles données de flux de
transaction après la reconnexion.
</para>

<para>
Expand Down
54 changes: 28 additions & 26 deletions postgresql/installation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ su - postgres
Pour compiler le langage de programmation serveur <application>PL/Python</application>,
il faut que <productname>Python</productname> soit installé avec les
fichiers d'en-tête et le module <application>distutils</application>. La
version requise minimum est <productname>Python</productname> 2.3.
(To work with function arguments of type <type>numeric</type>, a 2.3.x
installation must include the separately-available <filename>cdecimal</filename>
module; note the <application>PL/Python</application> regression tests
will not pass if that is missing.)
version minimum requise est <productname>Python</productname> 2.3.
(Pour fonctionner avec des arguments de fonction de type <type>numeric</type>,
une installation 2.3.x doit inclure le module disponible séparément
<filename>cdecimal</filename>; il est à noter que les tests de régression
de <application>PL/Python</application> échoueront s'il est manquant.)
<productname>Python 3</productname> est supporté s'il s'agit d'une
version 3.1 ou ultérieure&nbsp;; voir la
<phrase>documentation de <application>PL/Python</application></phrase>
Expand Down Expand Up @@ -622,11 +622,13 @@ su - postgres
<term><option>--with-extra-version=<replaceable>STRING</replaceable></option></term>
<listitem>
<para>
Append <replaceable>STRING</replaceable> to the PostgreSQL version number. You
can use this, for example, to mark binaries built from unreleased Git
snapshots or containing custom patches with an extra version string
such as a <command>git describe</command> identifier or a
distribution package release number.
Ajoute <replaceable>STRING</replaceable> au numéro de version de
PostgreSQL. Cela peut être utilisé, par exmeple, pour marquer des
binaires compilés depuis des instantanés Git ne faisant pas encore
partie d'une version officielle ou contenant des patchs particuliers
avec une chaînes de texte supplémentaire telle qu'un identifiant
<command>git describe</command> ou un numéro de version d'un paquet
d'une distribution.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -765,8 +767,8 @@ su - postgres
<term><option>--with-krb-srvnam=<replaceable>NOM</replaceable></option></term>
<listitem>
<para>
Le nom par défaut du service principal de Kerberos utilisé
GSSAPI. <literal>postgres</literal> est pris par défaut. Il n'y a
Le nom par défaut du service principal de Kerberos utilisé.
<literal>postgres</literal> est pris par défaut. Il n'y a
habituellement pas de raison de le changer sauf dans le cas d'un
environnement Windows, auquel cas il doit être mis en majuscule,
<literal>POSTGRES</literal>.
Expand Down Expand Up @@ -863,31 +865,31 @@ su - postgres
<term><option>--with-uuid=<replaceable>LIBRARY</replaceable></option></term>
<listitem>
<para>
Build the <phrase>uuid-ossp</phrase>
<phrase><xref linkend="uuid-ossp"/></phrase> module
(which provides functions to generate UUIDs), using the specified
UUID library.<indexterm><primary>UUID</primary></indexterm>
<replaceable>LIBRARY</replaceable> must be one of:
Compile le module <phrase>uuid-ossp</phrase> (qui fournit les
fonctions pour générer les UUID), en utilisant la bibliothèque UUID
spécifiée. <indexterm><primary>UUID</primary></indexterm>
<replaceable>LIBRARY</replaceable> doit correspondre à une de ces
valeurs&nbsp;:
</para>
<itemizedlist>
<listitem>
<para>
<option>bsd</option> to use the UUID functions found in FreeBSD, NetBSD,
and some other BSD-derived systems
<option>bsd</option> pour utiliser les fonctions UUID trouvées dans
FreeBSD, NetBSD et quelques autres systèmes dérivés de BSD
</para>
</listitem>
<listitem>
<para>
<option>e2fs</option> to use the UUID library created by
the <literal>e2fsprogs</literal> project; this library is present in most
Linux systems and in Mac OS X, and can be obtained for other
platforms as well
<option>e2fs</option> pour utiliser la bibliothèque UUID créée par
le projet <literal>e2fsprogs</literal>&nbsp;; cette bibliothèque est
présente sur la plupart des systèmes Linux et sur Mac OS X, et peut
être obtenu sur d'autres plateformes également
</para>
</listitem>
<listitem>
<para>
<option>ossp</option> to use the <ulink
url="http://www.ossp.org/pkg/lib/uuid/">OSSP UUID library</ulink>
<option>ossp</option> pour utiliser la <ulink
url="http://www.ossp.org/pkg/lib/uuid/">bibliothèque OSSP UUID</ulink>
</para>
</listitem>
</itemizedlist>
Expand All @@ -898,7 +900,7 @@ su - postgres
<term><option>--with-ossp-uuid</option></term>
<listitem>
<para>
Obsolete equivalent of <literal>--with-uuid=ossp</literal>.
Équivalent obsolète de <literal>--with-uuid=ossp</literal>.
</para>
</listitem>
</varlistentry>
Expand Down
44 changes: 23 additions & 21 deletions postgresql/postgres-fdw.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,23 +394,24 @@
</sect2>

<sect2>
<title>Examples</title>
<title>Exemples</title>

<para>
Here is an example of creating a foreign table with
<literal>postgres_fdw</literal>. First install the extension:
Voici un exemple de création d'une table distante avec
<literal>postgres_fdw</literal>. Tout d'abord, il faut installer l'extension&nbsp;:
</para>

<programlisting>
CREATE EXTENSION postgres_fdw;
</programlisting>

<para>
Then create a foreign server using <xref linkend="sql-createserver"/>.
In this example we wish to connect to a <productname>PostgreSQL</productname> server
on host <literal>192.83.123.89</literal> listening on
port <literal>5432</literal>. The database to which the connection is made
is named <literal>foreign_db</literal> on the remote server:
Ensuite, il faut créer un serveur distant avec <xref linkend="sql-createserver"/>.
Dans cet exemple, nous souhaitons nous connecter à un serveur
<productname>PostgreSQL</productname> sur l'hôte <literal>192.83.123.89</literal>
écoutant sur le port <literal>5432</literal>. La base de données sur le
serveur distant sur laquelle la connexion est faite s'appelle
<literal>foreign_db</literal>&nbsp;:

<programlisting>
CREATE SERVER foreign_server
Expand All @@ -420,9 +421,9 @@ CREATE SERVER foreign_server
</para>

<para>
A user mapping, defined with <xref linkend="sql-createusermapping"/>, is
needed as well to identify the role that will be used on the remote
server:
Une correspondance d'utilisateur, définie avec <xref linkend="sql-createusermapping"/>,
est également nécessaire pour identifier le rôle qui sera utilisé sur le
serveur distant&nbsp;:

<programlisting>
CREATE USER MAPPING FOR local_user
Expand All @@ -432,11 +433,11 @@ CREATE USER MAPPING FOR local_user
</para>

<para>
Now it is possible to create a foreign table with
<xref linkend="sql-createforeigntable"/>. In this example we
wish to access the table named <structname>some_schema.some_table</structname>
on the remote server. The local name for it will
be <structname>foreign_table</structname>:
Il est maintenant possible de créer une table distante avec <xref
linkend="sql-createforeigntable"/>. Dans cet exemple, nous souhaitons
accéder à la table nommée <structname>some_schema.some_table</structname>
sur le serveur distant. Le nom local pour celle-ci sera
<structname>foreign_table</structname>&nbsp;:

<programlisting>
CREATE FOREIGN TABLE foreign_table (
Expand All @@ -447,11 +448,12 @@ CREATE FOREIGN TABLE foreign_table (
OPTIONS (schema_name 'some_schema', table_name 'some_table');
</programlisting>

It's essential that the data types and other properties of the columns
declared in <command>CREATE FOREIGN TABLE</command> match the actual remote table.
Column names must match as well, unless you attach <literal>column_name</literal>
options to the individual columns to show how they are named in the remote
table.
Il est essentiel que les types de données et autres propriétés des colonnes
déclarées dans <command>CREATE FOREIGN TABLE</command> correspondent à la
vraie table distante. Les noms des colonnes doivent également correspondre,
à moins que des options <literal>column_name</literal> soient attachées aux
colonnes individuelles pour montrer comment elles sont nommées sur la table
distante.
</para>
</sect2>

Expand Down

0 comments on commit 75b0e44

Please sign in to comment.