Changeset 1044

Show
Ignore:
Timestamp:
05/17/08 10:17:55 (6 months ago)
Author:
daamien
Message:

1ere tarduction, à relire

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • traduc/trunk/slony/monitoring.xml

    r937 r1044  
    66 
    77<sect1 id="monitoring"> 
    8 <title>Monitoring</title> 
    9  
    10 <indexterm><primary>monitoring &slony1;</primary></indexterm> 
    11  
    12 <sect2> <title> &nagios; Replication Checks </title> 
    13  
    14 <indexterm><primary>&nagios; for monitoring replication</primary></indexterm> 
    15  
    16 <para> The script in the <filename>tools</filename> directory called 
    17 <command> psql_replication_check.pl </command> represents some of the 
    18 best answers arrived at in attempts to build replication tests to plug 
    19 into the <ulink url="http://www.nagios.org/"> &nagios; </ulink> system 
    20 monitoring tool.</para> 
    21  
    22 <para> A former script, <filename> 
    23 test_slony_replication.pl</filename>, took a <quote>clever</quote> 
    24 approach where a <quote>test script</quote> is periodically run, which 
    25 rummages through the &slony1; configuration to find origin and 
    26 subscribers, injects a change, and watches for its propagation through 
    27 the system.  It had two problems:</para> 
     8<title>Surveillance</title> 
     9 
     10<indexterm><primary>Surveiller &slony1;</primary></indexterm> 
     11 
     12<sect2> <title> Tester la replication avec &nagios; </title> 
     13 
     14<indexterm><primary>&nagios; pour surveiller la réplication</primary></indexterm> 
     15 
     16<para> Le script <command> psql_replication_check.pl </command>  qui se trouve  
     17  dans le répertoire <filename>tools</filename> regroupe les meilleures 
     18  tentatives de construire de création de tests utilisables par le systÚme  
     19  de surveillance <ulink url="http://www.nagios.org/"> &nagios;</ulink>.</para> 
     20 
     21<para> Un script antérieur, nommé <filename> 
     22test_slony_replication.pl</filename>, utilisait une approche <quote>intelligente</quote> 
     23: un <quote>script de test</quote> est exécuté périodiquement et se déploie à travers les configurations 
     24&slony1; pour trouver l'origine et les abonnés, injecte un changement et observe sa propagation  
     25à travers le systÚme. Il présentait deux problÚmes :</para> 
    2826<itemizedlist> 
    2927 
    30 <listitem><para> Connectivity problems to the 
    31 <emphasis>single</emphasis> host where the test ran would make it look 
    32 as though replication was destroyed.  Overall, this monitoring 
    33 approach has been fragile to numerous error conditions.</para> 
     28<listitem><para> En cas de problÚme de connectique impactant le noeud qui jouait ce test 
     29    c'est l'ensemble de réplication qui semblait détruite. De plus, cette stratégie de 
     30    surveillance est trÚs fragile et dépend de nombreuses conditions d'erreurs.</para> 
    3431</listitem> 
    3532 
    36 <listitem><para> &nagios; has no ability to benefit from the 
    37 <quote>cleverness</quote> of automatically exploring the set of nodes. 
    38 You need to set up a &nagios; monitoring rule for each and every node 
    39 being monitored.  </para> </listitem> 
     33<listitem><para> &nagios; n'a pas la possibilité de profiter de  
     34<quote>l'intelligence</quote> d'une exploration automatique d'un ensemble de noeuds. 
     35Vous devez mettre en place des rÚgles de surveillance &nagios; pour chaque noeud. 
     36</para> </listitem> 
    4037</itemizedlist> 
    4138 
    42 <para> The new script, <command>psql_replication_check.pl</command>, 
    43 takes the minimalist approach of assuming that the system is an online 
    44 system that sees regular <quote>traffic,</quote> so that you can 
    45 define a view specifically for the replication test called 
    46 <envar>replication_status</envar> which is expected to see regula
    47 updates.  The view simply looks for the youngest 
    48 <quote>transaction</quote> on the node, and lists its timestamp, age, 
    49 and some bit of application information that might seem useful to see
     39<para> Le nouveau script, <command>psql_replication_check.pl</command>, 
     40utilise une approche minimaliste qui suppose que le systÚme est une  
     41systÚme en ligne recevant un <quote>trafic</quote> régulier, et vous  
     42permet de définir une vue spécifique pour le test de replication appelée 
     43<envar>replication_status</envar> qui doit contenir des mises à jou
     44réguliÚres. Cette vue regarde simplement la derniÚre  
     45<quote>transaction</quote> sur le noeud, et liste son timestamp, son âge, 
     46ainsi que quelques informations sur l'application qui peuvent être utiles
    5047</para> 
    5148 
    5249<itemizedlist> 
    5350 
    54 <listitem><para> In an inventory system, that might be the order 
    55 number for the most recently processed order. </para> </listitem> 
    56  
    57 <listitem><para> In a domain registry, that might be the name of the 
    58 most recently created domain.</para> </listitem> 
     51<listitem><para>Pour un systÚme d'inventaire, cela pourrait être 
     52    le numéro de l'ordre effectué le plus récemment. </para> </listitem> 
     53 
     54<listitem><para>Pour un serveur de nom de domaines, cela peut être le nom  
     55    du dernier domaine crée.</para> </listitem> 
    5956 
    6057</itemizedlist> 
    6158 
    62 <para> An instance of the script will need to be run for each node 
    63 that is to be monitored; that is the way &nagios; works. </para> 
    64  
    65 </sect2> 
    66  
    67 <sect2 id="slonymrtg"> <title> Monitoring &slony1; using MRTG </title> 
    68  
    69 <indexterm><primary>MRTG for monitoring replication</primary></indexterm> 
    70  
    71 <para> One user reported on the &slony1; mailing list how to configure 
    72 <ulink url="http://people.ee.ethz.ch/~oetiker/webtools/mrtg/"> 
    73 <application> mrtg - Multi Router Traffic Grapher </application> 
    74 </ulink> to monitor &slony1; replication.</para> 
    75  
    76 <para> ... Since I use <application>mrtg</application> to graph data 
    77 from multiple servers I use snmp (<application>net-snmp</application> 
    78 to be exact).  On database server, I added the following line to 
    79 <application>snmpd</application> configuration:</para> 
     59<para> Une instance du script doit être lancée sur chaque noeud surveillé;  
     60  c'est ainsi que &nagios; fonctionne.</para> 
     61 
     62</sect2> 
     63 
     64<sect2 id="slonymrtg"> <title> Surveiller &slony1; avec MRTG </title> 
     65 
     66<indexterm><primary>Utiliser MRTG pour surveiller la réplication</primary></indexterm> 
     67 
     68<para> Un utilisateur a expliqué sur la liste de discussion de &slony1; comment 
     69  configurer <ulink url="http://people.ee.ethz.ch/~oetiker/webtools/mrtg/"> 
     70<application> mrtg ( Multi Router Traffic Grapher )</application> 
     71</ulink> pour surveiller une réplication &slony1;.</para> 
     72 
     73<para> ... Puisque j'utilise <application>mrtg</application> pour visualiser 
     74  les données depuis plusieurs serveurs, j'utilise SNMP  
     75  (<application>net-snmp</application> pour être exact).* 
     76  Pour un serveur de base de données, j'ai ajouté la ligne suivante à la configuration 
     77 <application>snmpd</application> :</para> 
    8078 
    8179<programlisting> 
    8280exec replicationLagTime  /cvs/scripts/snmpReplicationLagTime.sh 2 
    83 where <filename> /cvs/scripts/snmpReplicationLagTime.sh</filename> looks like this
     81avec <filename> /cvs/scripts/snmpReplicationLagTime.sh</filename> contenant ceci
    8482</programlisting> 
    8583 
     
    9290</programlisting> 
    9391 
    94 <para> Then, in mrtg configuration,  add this target:</para> 
     92<para> Ensuite, dans la configuration de mrtg, ajouter la cible suivante :</para> 
    9593<programlisting> 
    9694Target[db_replication_lagtime]:extOutput.3&amp;extOutput.3:public at db::30::: 
     
    102100 
    103101 
    104 <para> Alternatively, Ismail Yenigul points out how he managed to 
    105 monitor slony using <application>MRTG</application> without installing 
     102<para> De son coté, Ismail Yenigul propose une méthode pour surveiller 
     103  &slony1; en utilisant <application>MRTG</application> sans installer  
    106104<application>SNMPD</application>.</para> 
    107105 
    108 <para> Here is the mrtg configuration</para> 
     106<para>Voici sa configuration MRTG :</para> 
    109107 
    110108<programlisting> 
     
    116114</programlisting> 
    117115 
    118 <para> and here is the modified version of the script</para> 
     116<para> et voici sa version modifiée du script :</para> 
    119117 
    120118<programlisting> 
     
    132130 
    133131 
    134 <note><para> MRTG expects four lines from the script, and since there 
    135 are only two lines provided, the output must be padded to four 
    136 lines. </para> </note> 
     132<note><para> MRTG attend quatre lignes en provenance du script. Puisque le script n'en fournit 
     133    que deux, la sortie doit être prolongée de deux lignes. 
     134 </para> </note> 
    137135 
    138136</sect2> 
     
    140138<sect2 id="testslonystate"> <title> test_slony_state</title> 
    141139 
    142 <indexterm><primary>script test_slony_state to test replication state</primary></indexterm> 
    143  
    144 <para> This script does various sorts of analysis of the state of a 
    145 &slony1; cluster.</para> 
    146  
    147 <para> You specify arguments including <option>database</option>, 
    148 <option>host</option>, <option>user</option>, 
    149 <option>cluster</option>, <option>password</option>, and 
    150 <option>port</option> to connect to any of the nodes on a cluster. 
    151 You also specify a <option>mailprog</option> command (which should be 
    152 a program equivalent to <productname>Unix</productname> 
    153 <application>mailx</application>) and a recipient of email. </para> 
    154  
    155 <para> You may alternatively specify database connection parameters 
    156 via the environment variables used by 
    157 <application>libpq</application>, <emphasis>e.g.</emphasis> - using 
     140<indexterm><primary>script test_slony_state pour tester l'état de la réplication</primary></indexterm> 
     141 
     142<para> Ce script effectue différents analyses sur l'état d'un cluster  
     143&slony1;.</para> 
     144 
     145<para>Vous devez spécifier les arguments tels que <option>la base de données</option>, 
     146<option>l'hÃŽte</option>, <option>l'utilisateur</option>, 
     147<option>le cluster</option>, <option>le mot de passe</option>, et  
     148<option>le port</option> afin de se connecter à n'importe quel 
     149noeud du cluster. Vous devez également préciser une commande  
     150 <option>mailprog</option> ( qui doit être un commande équivalente  
     151à la commande <productname>Unix</productname> 
     152<application>mailx</application>) et une destination pour le courrier. </para> 
     153 
     154<para> Par ailleurs vous spécifier les paramÚtres de connexion aux bases de données 
     155  via les variables d'environnement utilisées par  
     156<application>libpq</application>, <emphasis>par exemple :</emphasis> - utiliser 
    158157<envar>PGPORT</envar>, <envar>PGDATABASE</envar>, 
    159 <envar>PGUSER</envar>, <envar>PGSERVICE</envar>, and such.</para> 
    160  
    161 <para> The script then rummages through <xref linkend="table.sl-path"/> 
    162 to find all of the nodes in the cluster, and the DSNs to allow it to, 
    163 in turn, connect to each of them.</para> 
    164  
    165 <para> For each node, the script examines the state of things, 
    166 including such things as: 
     158<envar>PGUSER</envar>, <envar>PGSERVICE</envar>, et ainsi de suite.</para> 
     159 
     160<para>Le script se promÚne à travers <xref linkend="table.sl-path"/> 
     161pour trouver tous les noeuds du cluster, et dans les DSNs qui lui  
     162permettront de se connecter à chaque noeud.</para> 
     163 
     164<para> Pour chaque noeud, le script examine l'état des données suivantes : 
    167165 
    168166<itemizedlist> 
    169 <listitem><para> Checking <xref linkend="table.sl-listen"/> for some 
    170 <quote>analytically determinable</quote> problems.  It lists paths 
    171 that are not covered.</para></listitem> 
    172  
    173 <listitem><para> Providing a summary of events by origin node</para> 
    174  
    175 <para> If a node hasn't submitted any events in a while, that likely 
    176 suggests a problem.</para></listitem> 
    177  
    178 <listitem><para> Summarizes the <quote>aging</quote> of table <xref 
     167<listitem><para> Vérification de <xref linkend="table.sl-listen"/>  
     168    à la recherche de problÚmes 
     169<quote>déterminés analytiquement</quote>. Cela liste les voies de communication 
     170qui ne sont pas couvertes.</para></listitem> 
     171 
     172<listitem><para> Effectuer un résumé des événements sur le noeud d'origine</para> 
     173 
     174<para> Si un noeud n'a pas soumis un événement depuis longtemps, il y a certainement 
     175  un problÚme.</para></listitem> 
     176 
     177<listitem><para> Vérification de <quote>l'âge</quote> de la table <xref 
    179178linkend="table.sl-confirm"/> </para> 
    180179 
    181 <para> If one or another of the nodes in the cluster hasn't reported 
    182 back recently, that tends to lead to cleanups of tables like <xref 
    183 linkend="table.sl-log-1"/> and <xref linkend="table.sl-seqlog"/> not 
    184 taking place.</para></listitem> 
    185  
    186 <listitem><para> Summarizes what transactions have been running for a 
    187 long time</para> 
    188  
    189 <para> This only works properly if the statistics collector is 
    190 configured to collect command strings, as controlled by the option 
    191 <option> stats_command_string = true </option> in <filename> 
     180<para> Si un ou plusieurs noeuds du cluster n'ont pas envoyé de rapport récemment 
     181  alors cela peut conduire à l'absence de nettoyage dans certaines tables comme  
     182  <xref linkend="table.sl-log-1"/> et <xref linkend="table.sl-seqlog"/></para></listitem> 
     183 
     184<listitem><para> Vérifications des transactions longues</para> 
     185 
     186<para> Ceci ne fonctionne correctement que si le collecteur de statistique  
     187  est configuré pour collecter les requêtes, c'est à dire l'option    
     188 <option> stats_command_string = true</option> est présente dans <filename> 
    192189postgresql.conf </filename>.</para> 
    193190 
    194 <para> If you have broken applications that hold connections open, 
    195 this will find them.</para> 
    196  
    197 <para> If you have broken applications that hold connections open, 
    198 that has several unsalutory effects as <link 
    199 linkend="longtxnsareevil"> described in the 
    200 FAQ</link>.</para></listitem> 
     191<para> Si des bugs applicatifs conservent des connexions ouvertes, ce script devrait les trouver 
     192.</para> 
     193 
     194<para> Si des bugs applicatifs conservent des connexions ouvertes,  
     195  plusieurs effets négatifs sont à prévoir   
     196  tels que <link 
     197linkend="longtxnsareevil">ceux décrits dans la FAQ  
     198</link>.</para></listitem> 
    201199 
    202200</itemizedlist></para> 
    203201 
    204 <para> The script does some diagnosis work based on parameters in the 
    205 script; if you don't like the values, pick your favorites!</para> 
     202<para> Ce script fait des diagnostiques basé sur des paramÚtres défini dans le script 
     203  ; si vous n'aimez pas les valeurs par défaut, modifiez-les !</para> 
    206204 
    207205</sect2> 
     
    209207<sect2 id="search-logs"> <title> <command>search-logs.sh</command> </title> 
    210208 
    211 <indexterm><primary> search &slony1; logs using search-logs.sh </primary></indexterm> 
    212  
    213 <para> This script is constructed to search for &slony1; log files at 
    214 a given path (<envar>LOGHOME</envar>), based both on the naming 
    215 conventions used by the <xref linkend="launchclusters"/> and <xref 
    216 linkend="slonwatchdog"/> systems used for launching &lslon;  
    217 processes.</para> 
    218  
    219 <para> Errors, if found, are listed, by log file, and emailed to the 
    220 specified user (<envar>LOGRECIPIENT</envar>); if no email address is 
    221 specified, output goes to standard output. </para> 
    222  
    223 <para> <envar>LOGTIMESTAMP</envar> allows overriding what hour to 
    224 evaluate (rather than the last hour). </para> 
    225  
    226 <para> An administrator might run this script once an hour to monitor 
    227 for replication problems. </para> 
    228 </sect2> 
    229  
    230 <sect2 id="wikigen"> <title> Building MediaWiki Cluster Summary </title> 
    231  
    232 <indexterm><primary> generating Wiki documentation of a cluster </primary></indexterm> 
    233  
    234 <para> The script <filename>mkmediawiki.pl </filename>, in 
    235 <filename>tools</filename>, may be used to generate a cluster summary 
    236 compatible with the popular <ulink url="http://www.mediawiki.org/"> 
    237 MediaWiki </ulink> software. Note that the 
    238 <option>--categories</option> permits the user to specify a set of 
    239 (comma-delimited) categories with which to associate the output.  If 
    240 you have a series of &slony1; clusters, passing in the option 
    241 <option>--categories=slony1</option> leads to the MediaWiki instance 
    242 generating a category page listing all &slony1; clusters so 
    243 categorized on the wiki.  </para> 
    244  
    245 <para> The gentle user might use the script as follows: </para> 
     209<indexterm><primary> Chercher les logs  &slony1; avec search-logs.sh </primary></indexterm> 
     210 
     211<para> Ce script est construit pour chercher les fichiers de trace &slony1; 
     212  dans un emplacement donné (<envar>LOGHOME</envar>), en se basant à la fois 
     213  sur les conventions de nommage utilisées par les systÚmes  
     214  <xref linkend="launchclusters"/> et <xref linkend="slonwatchdog"/> lors du démarrage  
     215  des processus &lslon;.</para> 
     216 
     217<para> Si des erreurs sont trouvées, elles sont listées pour chaque fichiers  
     218  et transmises par courriel à un utilisateur spécifié  (<envar>LOGRECIPIENT</envar>); 
     219  si aucune adresse courriel n'est spécifiée, le résultat est affiché sur la sortie standard 
     220  . </para> 
     221 
     222<para> <envar>LOGTIMESTAMP</envar> permet de surcharger quelle heure doit être évaluée 
     223  (plutÃŽt que la derniÚre heure). </para> 
     224 
     225<para> Un administrateur peut exécuter ce script une fois par heure  
     226  pour surveiller les problÚmes de réplication.  
     227</para> 
     228</sect2> 
     229 
     230<sect2 id="wikigen"> <title>Produire un rapport de surveillance au format MediaWiki</title> 
     231 
     232<indexterm><primary> générer la documentation Wiki d'un cluster </primary></indexterm> 
     233 
     234<para>Le script <filename>mkmediawiki.pl </filename>, situé dans  
     235  <filename>tools</filename>, peut être utilisé pour générer un rapport de 
     236  surveillance du cluster compatible avec le logiciel populaire  
     237  <ulink url="http://www.mediawiki.org/">MediaWiki </ulink>. 
     238  Notons que l'option <option>--categories</option> permet à l'utilisateur  
     239  de préciser un ensemble de catégories (séparées par une virgule) qui seront 
     240  associées aux résultats. Si vous avez une série de clusters &slony1; 
     241  passer l'option <option>--categories=slony1</option> entraînera la création 
     242  d'une page catégorie répertoriant l'ensemble des clusters &slony1;. </para> 
     243 
     244<para>On pourra utiliser le commande ainsi: </para> 
    246245 
    247246<screen> 
     
    253252</screen> 
    254253 
    255 <para> Note that <command>mvs</command> is a client written in Perl; 
    256 on <ulink url="http://www.debian.org/"> Debian GNU/Linux</ulink>, the 
    257 relevant package is called 
    258 <application>libwww-mediawiki-client-perl</application>; other system
    259 may have a packaged version of this under some similar name. </para> 
     254<para> Notons que <command>mvs</command> est un client Mediawiki écrit en Perl; 
     255sur <ulink url="http://www.debian.org/"> Debian GNU/Linux</ulink>, le paquet 
     256associé est nommé 
     257<application>libwww-mediawiki-client-perl</application>; d'autres systÚme
     258dispose probablement d'une version packagée sous un nom similaire. </para> 
    260259 
    261260</sect2>