| 18 | | <title>General outline</title> |
|---|
| 19 | | |
|---|
| 20 | | <para> |
|---|
| 21 | | The <application>slonik</application> commandline utility is |
|---|
| 22 | | supposed to be used embedded into shell scripts and reads |
|---|
| 23 | | commands from files or stdin (via here documents for |
|---|
| 24 | | example). Nearly all of the <emphasis>real</emphasis> |
|---|
| 25 | | configuration work is done by calling stored procedures after |
|---|
| 26 | | loading the &slony1; support base into |
|---|
| 27 | | a database. You may find documentation for those procedures in |
|---|
| 28 | | the <ulink url="schemadoc">&slony1; |
|---|
| 29 | | Schema Documentation</ulink>, as well as in comments associated |
|---|
| 30 | | with them in the database. |
|---|
| 31 | | </para> |
|---|
| 32 | | |
|---|
| 33 | | <para> |
|---|
| 34 | | <application>Slonik</application> was created because: |
|---|
| | 18 | <title>Considérations générales</title> |
|---|
| | 19 | |
|---|
| | 20 | <para> |
|---|
| | 21 | L'utilitaire en ligne de commande <application>slonik</application> |
|---|
| | 22 | est suppposé être intégré dans des scripts shell et lit |
|---|
| | 23 | les commandes à partir d'un fichier ou de stdin ( voir plus |
|---|
| | 24 | bas pour des exemples ). Presque tout le travail de configuration |
|---|
| | 25 | <emphasis>réel</emphasis> est effectué en appelant des procédures |
|---|
| | 26 | stockées aprÚs avoir chargé la base de support &slony1; dans |
|---|
| | 27 | la base de données. Vous pouvez trouver de la documentation sur |
|---|
| | 28 | ces procédures dans le chapitre <ulink url="schemadoc">&slony1; |
|---|
| | 29 | Documentation du Schéma</ulink>, ainsi que dans les commentaires |
|---|
| | 30 | qui sont associé aux procédures dans la base de données. |
|---|
| | 31 | </para> |
|---|
| | 32 | |
|---|
| | 33 | <para> |
|---|
| | 34 | <application>Slonik</application> a été créé car: |
|---|
| 55 | | The slonik command language is format free. Commands begin with |
|---|
| 56 | | keywords and are terminated with a semicolon. Most commands have |
|---|
| 57 | | a list of parameters, some of which have default values and are |
|---|
| 58 | | therefore optional. The parameters of commands are enclosed in |
|---|
| 59 | | parentheses. Each option consists of one or more keywords, |
|---|
| 60 | | followed by an equal sign, followed by a value. Multiple options |
|---|
| 61 | | inside the parentheses are separated by commas. All keywords are |
|---|
| 62 | | case insensitive. The language should remind the reader of SQL. |
|---|
| | 56 | Le format du langage de commande slonik est libre. |
|---|
| | 57 | Les commandes commence par des mots-clefs et sont terminées |
|---|
| | 58 | par un point-virgule. La pluspart des commande ont une liste de |
|---|
| | 59 | paramÚtres, certains ont une valeur par défaut et sont donc |
|---|
| | 60 | facultatifs. Les paramÚtres de commandes sont entourés par des |
|---|
| | 61 | parenthÚses. Chaque option est constituée d'un ou plusieurs |
|---|
| | 62 | mots-clefs, suivis d'un symbole égal, suivi d'une valeur. Les |
|---|
| | 63 | optons multiples à l'intérieur de parenthÚses sont séparées par |
|---|
| | 64 | des virgules. Tous les mot-clefs sont sensibles à la casse. Le |
|---|
| | 65 | langage devrait rappeler le SQL. |
|---|
| 67 | | <listitem><para>integer values</para></listitem> |
|---|
| 68 | | <listitem><para>string literals enclosed in single quotes</para></listitem> |
|---|
| 69 | | <listitem><para>boolean values {TRUE|ON|YES} or {FALSE|OFF|NO}</para></listitem> |
|---|
| 70 | | <listitem><para>keywords for special cases</para></listitem> |
|---|
| | 70 | <listitem><para>des entiers;</para></listitem> |
|---|
| | 71 | <listitem><para>des chaines caractÚres entourés de quotes;</para></listitem> |
|---|
| | 72 | <listitem><para>des valeurs booléennes {TRUE|ON|YES} ou {FALSE|OFF|NO};</para></listitem> |
|---|
| | 73 | <listitem><para>des mots-clefs dans des cas spécifiques</para></listitem> |
|---|
| 98 | | The following commands may be used to somewhat abstract the |
|---|
| 99 | | definitions of components of Slonik scripts; <xref |
|---|
| 100 | | linkend="stmtinclude"/> grouping configuration into central files |
|---|
| 101 | | that may be reused, and <xref linkend="stmtdefine"/> allowing |
|---|
| 102 | | mnemonic identifiers to replace cryptic numeric object IDs. |
|---|
| | 102 | Les commandes suivantes sont utilisées pour séparer |
|---|
| | 103 | les définitions des composants des scripts Slonik; |
|---|
| | 104 | <xref linkend="stmtinclude"/> regroupe la configuration |
|---|
| | 105 | dans des fichiers centraux qui peuvent être réutilisés, et |
|---|
| | 106 | <xref linkend="stmtdefine"/> permet de remplacer les identifiants |
|---|
| | 107 | numérique et esotérique des objets par des identifiants mnémotechniques. |
|---|
| 116 | | <arg><replaceable class="parameter"> <pathname></replaceable></arg> |
|---|
| 117 | | </cmdsynopsis> |
|---|
| 118 | | </refsynopsisdiv> |
|---|
| 119 | | <refsect1> |
|---|
| 120 | | <title>Description</title> |
|---|
| 121 | | <para> |
|---|
| 122 | | This draws the specified slonik script inline into the present |
|---|
| 123 | | script. If the <option>pathname</option> specifies a relative |
|---|
| 124 | | path, <xref linkend="slonik"/> will search relative to the |
|---|
| 125 | | current working directory. |
|---|
| 126 | | </para> |
|---|
| 127 | | |
|---|
| 128 | | <para> |
|---|
| 129 | | Nested include files are supported. The scanner and parser |
|---|
| 130 | | report the proper file names and line numbers when they run into |
|---|
| 131 | | an error. </para> |
|---|
| 132 | | </refsect1> |
|---|
| 133 | | <refsect1><title>Example</title> |
|---|
| | 121 | <arg><replaceable class="parameter"> <chemin></replaceable></arg> |
|---|
| | 122 | </cmdsynopsis> |
|---|
| | 123 | </refsynopsisdiv> |
|---|
| | 124 | <refsect1> |
|---|
| | 125 | <title>Description</title> |
|---|
| | 126 | <para> |
|---|
| | 127 | Ceci injecte le script slonik spécifié à l'intérieur du script actuel. |
|---|
| | 128 | Si le <option>chemin</option> est relatif, <xref linkend="slonik"/> |
|---|
| | 129 | cherchera à partir du répertoire de travail. |
|---|
| | 130 | </para> |
|---|
| | 131 | |
|---|
| | 132 | <para> |
|---|
| | 133 | Les inclusions imbriquées sont supportées. Le scanner et l'analyser |
|---|
| | 134 | retourne le bon nom de fichier et le numéro ligne correcten cas |
|---|
| | 135 | d'erreur. |
|---|
| | 136 | </para> |
|---|
| | 137 | </refsect1> |
|---|
| | 138 | <refsect1><title>Exemple</title> |
|---|
| 153 | | <arg><replaceable class="parameter"> name </replaceable></arg> |
|---|
| 154 | | <arg><replaceable class="parameter"> value </replaceable></arg> |
|---|
| 155 | | </cmdsynopsis> |
|---|
| 156 | | </refsynopsisdiv> |
|---|
| 157 | | <refsect1> |
|---|
| 158 | | <title>Description</title> |
|---|
| 159 | | <para> |
|---|
| 160 | | This defines a named symbol. Symbol names must follow the |
|---|
| 161 | | slonik rules for constructing identifiers, by starting with a |
|---|
| 162 | | letter, followed by letters, numbers, and underscores. |
|---|
| 163 | | </para> |
|---|
| 164 | | |
|---|
| 165 | | <para> |
|---|
| 166 | | Symbol values may contain spaces and may recursively contain |
|---|
| 167 | | symbol references. |
|---|
| 168 | | </para> |
|---|
| 169 | | |
|---|
| 170 | | <para> |
|---|
| 171 | | Symbols are referenced by using a <quote>@</quote> followed by |
|---|
| 172 | | the symbol name. Note that symbol referencing is suppressed |
|---|
| 173 | | inside string literals. |
|---|
| 174 | | </para> |
|---|
| 175 | | </refsect1> |
|---|
| 176 | | <refsect1><title>Example</title> |
|---|
| 177 | | <programlisting> |
|---|
| 178 | | define cluster movies; |
|---|
| | 158 | <arg><replaceable class="parameter"> nom </replaceable></arg> |
|---|
| | 159 | <arg><replaceable class="parameter"> valeur </replaceable></arg> |
|---|
| | 160 | </cmdsynopsis> |
|---|
| | 161 | </refsynopsisdiv> |
|---|
| | 162 | <refsect1> |
|---|
| | 163 | <title>Description</title> |
|---|
| | 164 | <para> |
|---|
| | 165 | Ceci définit un nom symbolique. Les noms symboliques doivent |
|---|
| | 166 | respecter les rÚgles de slonik en matiÚre de construction d'identifiant, |
|---|
| | 167 | en commençant par une lettre, suivie de lettres, de nombres et de soulignés ("_"). |
|---|
| | 168 | </para> |
|---|
| | 169 | |
|---|
| | 170 | <para> |
|---|
| | 171 | Les valeurs des noms symboliques peuvent contenir des espaces et peuvent contenir |
|---|
| | 172 | des références à des noms symboliques, de maniÚre récursive. |
|---|
| | 173 | </para> |
|---|
| | 174 | |
|---|
| | 175 | <para> |
|---|
| | 176 | Les symboles sont réferencés en utilisant une arobase <quote>@</quote> suivi |
|---|
| | 177 | du nom symbolique. Notons que le référencement d'un symbole est annulé |
|---|
| | 178 | à l'intérieur des chaines de caractÚres. |
|---|
| | 179 | </para> |
|---|
| | 180 | </refsect1> |
|---|
| | 181 | <refsect1><title>Exemple</title> |
|---|
| | 182 | <programlisting> |
|---|
| | 183 | define cluster films; |
|---|
| 186 | | define setMovies id = 1; |
|---|
| 187 | | define sakaiMovies @setMovies, origin = @sakai; |
|---|
| 188 | | |
|---|
| 189 | | create set ( @sakaiMovies, comment = 'movies' ); |
|---|
| 190 | | |
|---|
| 191 | | set add table( set @sakaiMovies, id = 1, @fqn = 'public.customers', |
|---|
| | 191 | define setFilms id = 1; |
|---|
| | 192 | define sakaiFilms @setFilms, origin = @sakai; |
|---|
| | 193 | |
|---|
| | 194 | create set ( @sakaiFilms, comment = 'films' ); |
|---|
| | 195 | |
|---|
| | 196 | set add table( set @sakaiFilms, id = 1, @fqn = 'public.clients', |
|---|
| 193 | | set add table( set @sakaiMovies, id = 2, @fqn = 'public.tapes', |
|---|
| 194 | | comment = 'sakai tapes' ); |
|---|
| 195 | | echo 'But @sakaiMovies will display as a string, and is not expanded'; |
|---|
| 196 | | </programlisting> |
|---|
| 197 | | </refsect1> |
|---|
| 198 | | |
|---|
| 199 | | <refsect1> <title> Version Information </title> |
|---|
| 200 | | <para> This command was introduced in &slony1; 1.1 </para> |
|---|
| | 198 | set add table( set @sakaiFilms, id = 2, @fqn = 'public.cassettes', |
|---|
| | 199 | comment = 'sakai cassettes' ); |
|---|
| | 200 | echo '@sakaiFilms sera affiché comme une chaine, et ne sera pas interprété'; |
|---|
| | 201 | </programlisting> |
|---|
| | 202 | </refsect1> |
|---|
| | 203 | |
|---|
| | 204 | <refsect1> <title> Note de version </title> |
|---|
| | 205 | <para> Cette commande fut introduite dans &slony1; 1.1 </para> |
|---|
| 212 | | The following commands must appear as a <quote>preamble</quote> at |
|---|
| 213 | | the beginning of each <application>slonik</application> command |
|---|
| 214 | | script. They do not cause any direct action on any of the nodes in |
|---|
| 215 | | the replication system, but affect the execution of the entire |
|---|
| 216 | | script. |
|---|
| | 217 | Les commandes suivantes doivent apparaître en <quote>préambule</quote> au |
|---|
| | 218 | de chaque script de commande <application>slonik</application>. |
|---|
| | 219 | Ils ne provoque aucune action directement sur les noeuds du |
|---|
| | 220 | systÚme de réplication, mais affecte l'exécution du script tout entier. |
|---|
| 231 | | <arg><replaceable class="parameter"> clustername;</replaceable></arg> |
|---|
| 232 | | </cmdsynopsis> |
|---|
| 233 | | </refsynopsisdiv> |
|---|
| 234 | | <refsect1> |
|---|
| 235 | | <title>Description</title> |
|---|
| 236 | | <para> |
|---|
| 237 | | Must be the very first statement in every |
|---|
| 238 | | <application>slonik</application> script. It defines the |
|---|
| 239 | | namespace in which all &slony1; |
|---|
| 240 | | specific functions, procedures, tables and sequences are |
|---|
| 241 | | defined. The namespace name is built by prefixing the given |
|---|
| 242 | | string literal with an underscore. This namespace will be |
|---|
| 243 | | identical in all databases that participate in the same |
|---|
| 244 | | replication group. |
|---|
| 245 | | </para> |
|---|
| 246 | | |
|---|
| 247 | | <para> |
|---|
| 248 | | No user objects are supposed to live in this namespace, and the |
|---|
| 249 | | namespace is not allowed to exist prior to adding a database to |
|---|
| 250 | | the replication system. Thus, if you add a new node using |
|---|
| 251 | | <command> pg_dump -s </command> on a database that is already in |
|---|
| 252 | | the cluster of replicated databases, you will need to drop the |
|---|
| 253 | | namespace via the SQL command <command> DROP SCHEMA _testcluster |
|---|
| 254 | | CASCADE; </command>. |
|---|
| 255 | | </para> |
|---|
| 256 | | </refsect1> |
|---|
| 257 | | <refsect1><title>Example</title> |
|---|
| | 235 | <arg><replaceable class="parameter"> nom;</replaceable></arg> |
|---|
| | 236 | </cmdsynopsis> |
|---|
| | 237 | </refsynopsisdiv> |
|---|
| | 238 | <refsect1> |
|---|
| | 239 | <title>Description</title> |
|---|
| | 240 | <para> |
|---|
| | 241 | Ceci doit être la toute premiÚre ligne de chaque script |
|---|
| | 242 | <application>slonik</application>. Elle définit l'espace |
|---|
| | 243 | de nom dans lequel toutes les fonctions spécifiques, les procédures, |
|---|
| | 244 | les tables et les séquences de &slony1; sont déclarées. |
|---|
| | 245 | Le nom de l'espace de nom est construit en préfixant le chaine |
|---|
| | 246 | de caractÚre fournie par un souligné. Ce nom d'espace sera |
|---|
| | 247 | identique sur toutes les bases de données qui participent |
|---|
| | 248 | aux même groupe de réplication. |
|---|
| | 249 | </para> |
|---|
| | 250 | |
|---|
| | 251 | <para> |
|---|
| | 252 | Aucun objet utilisateur n'est supposé être placé dans cet espace de nom, |
|---|
| | 253 | et l'espace de nom ne doit exister avant l'ajout de la base de données |
|---|
| | 254 | dans le systÚme de réplication. Ainsi, si vous ajouter un nouveau noeud |
|---|
| | 255 | en utilisant <command> pg_dump -s </command> sur une base qui est déjà |
|---|
| | 256 | dans le cluster de réplication, vous devrez supprimer l'espace de nom |
|---|
| | 257 | avec la commande SQL<command> DROP SCHEMA _testcluster CASCADE; </command>. |
|---|
| | 258 | </para> |
|---|
| | 259 | </refsect1> |
|---|
| | 260 | <refsect1><title>Exemple</title> |
|---|
| 286 | | Describes how the <application>slonik</application> utility can |
|---|
| 287 | | reach a nodes database in the cluster from where it is run |
|---|
| 288 | | (likely the DBA's workstation). The conninfo string is the string |
|---|
| 289 | | agrument given to the <function>PQconnectdb()</function> libpq |
|---|
| 290 | | function. The user used to connect must be the special |
|---|
| 291 | | replication superuser, as some of the actions performed later may |
|---|
| 292 | | include operations that are strictly reserved for database |
|---|
| 293 | | superusers by &postgres;. |
|---|
| 294 | | </para> |
|---|
| 295 | | |
|---|
| 296 | | <para> |
|---|
| 297 | | The <application>slonik</application> utility will not try to |
|---|
| 298 | | connect to a given database unless some subsequent command |
|---|
| 299 | | requires the connection. |
|---|
| | 289 | Décrit comment l'utilitaire <application>slonik</application> peut |
|---|
| | 290 | atteindre les bases des noeuds du cluster à partir du l'endroit |
|---|
| | 291 | où il se trouve (en général le poste de travail de l'administrateur) |
|---|
| | 292 | La chaine connifo est l'argument passé à la fonction |
|---|
| | 293 | libpq <function>PQconnectdb()</function>. L'utlisateur qui se connecter |
|---|
| | 294 | doit être un super-utilisateur spécifique à la réplication, car certaines |
|---|
| | 295 | actions réalisées par la suite comprennent des opérations strictement réservées |
|---|
| | 296 | aux super-utilisateurs du serveur &postgres;. |
|---|
| | 297 | </para> |
|---|
| | 298 | |
|---|
| | 299 | <para> |
|---|
| | 300 | L'utilitaire <application>slonik</application> n'essaie pas de se connecter |
|---|
| | 301 | à une base de donnnée que si un commande nécessite une connexion. |
|---|
| 303 | | As mentioned in the original documents, |
|---|
| 304 | | &slony1; is designed as an enterprise |
|---|
| 305 | | replication system for data centers. It has been assumed |
|---|
| 306 | | throughout the entire development that the database servers and |
|---|
| 307 | | administrative workstations involved in replication and/or setup |
|---|
| 308 | | and configuration activities can use simple authentication |
|---|
| 309 | | schemes like <quote>trust</quote>. Alternatively, libpq can read |
|---|
| 310 | | passwords from <filename> .pgpass </filename>. |
|---|
| | 305 | Comme indique dans les document originaux, &slony1; est conçu comme |
|---|
| | 306 | une systÚme de réplication d'entreprises pour datacenters. Lors du développement |
|---|
| | 307 | du logiciel, on présuppose que les serveurs de bases de données et les postes |
|---|
| | 308 | de travail impliqués dans la réplication et/ou dans les activités de mise en place et |
|---|
| | 309 | de configuration peuvent utiliser des méthodes simples d'authentification telle que |
|---|
| | 310 | <quote>trust</quote>. Cependant, libpq peut lire les mots de passe dans le fichier |
|---|
| | 311 | <filename> .pgpass </filename>. |
|---|
| 315 | | If you need to change the DSN information for a node, as would |
|---|
| 316 | | happen if the IP address for a host were to change, you must |
|---|
| 317 | | submit the new information using the <xref |
|---|
| 318 | | linkend="stmtstorepath"/> command, and that configuration will be |
|---|
| 319 | | propagated. Existing <application> slon </application> processes |
|---|
| 320 | | may need to be restarted in order to become aware of the |
|---|
| 321 | | configuration change. |
|---|
| | 316 | Si vous devez changer les informations DSN pour un noeud, par exemple si |
|---|
| | 317 | l'adresse IP d'un hÎte est modifiée, vous devez soumettre cette nouvelle |
|---|
| | 318 | information avec la commande <xref linkend="stmtstorepath"/>, |
|---|
| | 319 | et la configuration sera propagée. Certains processus |
|---|
| | 320 | <application> slon </application> existant devront être relancés afin qu'il |
|---|
| | 321 | soient avertis de ce changement de configuration. |
|---|
| 393 | | Terminates script execution immediately, rolling back every |
|---|
| 394 | | open transaction on all database connections. The |
|---|
| 395 | | <application>slonik</application> utility |
|---|
| 396 | | will return the given value as its program termination code. |
|---|
| | 393 | termine immédiatement un script d'éxecution, annulant toute |
|---|
| | 394 | les transaction ouverte (roll back) sur toutes les bases de données |
|---|
| | 395 | connectées. L'utilitaire <application>slonik</application> retournera |
|---|
| | 396 | la valeur indiquée comme code de terminaison du programme. |
|---|
| 428 | | <para> Initialize the first node in a new &slony1; replication |
|---|
| 429 | | cluster. The initialization process consists of creating the |
|---|
| 430 | | cluster namespace, loading all the base tables, functions, |
|---|
| 431 | | procedures and initializing the node, using |
|---|
| 432 | | &funinitializelocalnode; and &funenablenode;. |
|---|
| | 428 | <para> Initialise le premier noeud d'un nouveau cluster de réplication &slony1;. |
|---|
| | 429 | Le processus d'initialisation consiste à créer l'espace de nom du cluster, |
|---|
| | 430 | charger toutes les tables, les functions, les procédures et initialiser le noeud |
|---|
| | 431 | avec &funinitializelocalnode; and &funenablenode;. |
|---|
| 448 | | <para> For this process to work, the SQL scripts of the |
|---|
| 449 | | &slony1; system must be installed on the |
|---|
| 450 | | DBA workstation (the computer currently executing the |
|---|
| 451 | | <application>slonik</application> utility), while on the system |
|---|
| 452 | | where the node database is running the shared objects of the |
|---|
| 453 | | &slony1; system must be installed in the |
|---|
| 454 | | &postgres; library directory. Also the procedural language |
|---|
| 455 | | PL/pgSQL is assumed to already be installed in the target |
|---|
| 456 | | database.</para> |
|---|
| 457 | | </refsect1> |
|---|
| 458 | | <refsect1> |
|---|
| 459 | | <title>Example</title> |
|---|
| | 447 | <para> Pour que ce processus fonctionne, les scripts SQL du systÚme |
|---|
| | 448 | &slony1; doivent être installés sur le poste de travail de l'administrateur |
|---|
| | 449 | (l'ordinateur utilisé pour exécuter l'utilitaire <application>slonik</application>), |
|---|
| | 450 | tandis que sur le serveur qui héberge le noeud de base de donnée contenant les |
|---|
| | 451 | objets partagés, &slony1; doit être installé dans le répertoire qui contient |
|---|
| | 452 | les librairies de &postgres;. De plus le langage procédural |
|---|
| | 453 | PL/pgSQL dit être installé au préalable sur la base de données cible. |
|---|
| | 454 | </para> |
|---|
| | 455 | </refsect1> |
|---|
| | 456 | <refsect1> |
|---|
| | 457 | <title>Exemple</title> |
|---|
| 473 | | <note> <para> Be aware that some objects are created that contain |
|---|
| 474 | | the cluster name as part of their name. (Notably, partial indexes |
|---|
| 475 | | on <envar>sl_log_1</envar> and <envar>sl_log_2</envar>.) As a |
|---|
| 476 | | result, <emphasis>really long</emphasis> cluster names are a bad |
|---|
| 477 | | idea, as they can make object names <quote>blow up</quote> past the |
|---|
| 478 | | typical maximum name length of 63 characters. </para> </note> |
|---|
| 479 | | </refsect1> |
|---|
| 480 | | <refsect1> <title> Locking Behaviour </title> |
|---|
| 481 | | |
|---|
| 482 | | <para> This command creates a new namespace and configures tables |
|---|
| 483 | | therein; no public objects should be locked during the duration of |
|---|
| 484 | | this.</para> |
|---|
| 485 | | </refsect1> |
|---|
| 486 | | <refsect1> <title> Version Information </title> |
|---|
| 487 | | <para> This command was introduced in &slony1; 1.0 </para> |
|---|
| | 469 | <note> <para> Soyez conscients que certains objets qui sont créés contiennet |
|---|
| | 470 | le nom du cluster à l'intérieur de leur nom (Notamment, les index |
|---|
| | 471 | partiels sur <envar>sl_log_1</envar> et <envar>sl_log_2</envar>). |
|---|
| | 472 | Ceci implique que les noms de cluster <emphasis>trÚs longs</emphasis> |
|---|
| | 473 | sont une mauvaise idée, car ils entrainent un dépassement des noms |
|---|
| | 474 | d'objets au delà de la limite de 63 caractÚres. |
|---|
| | 475 | </para> </note> |
|---|
| | 476 | </refsect1> |
|---|
| | 477 | <refsect1> <title> Utilisation de verrous </title> |
|---|
| | 478 | |
|---|
| | 479 | <para> Cette commande crée un nouvel espace de noms et configure les |
|---|
| | 480 | tables à l'intérieur; aucun objets public ne doit être verrouiller |
|---|
| | 481 | pendant l'exécution de cette commade.</para> |
|---|
| | 482 | </refsect1> |
|---|
| | 483 | <refsect1> <title> Note de version </title> |
|---|
| | 484 | <para> Cette commande fut introduite dans &slony1; 1.0 </para> |
|---|
| 507 | | <para> Initialize a new node and add it to the configuration of an |
|---|
| 508 | | existing cluster.</para> |
|---|
| 509 | | |
|---|
| 510 | | <para> The initialization process consists of creating the cluster |
|---|
| 511 | | namespace in the new node (the database itself must already |
|---|
| 512 | | exist), loading all the base tables, functions, procedures and |
|---|
| 513 | | initializing the node. The existing configuration of the rest of |
|---|
| 514 | | the cluster is copied from the <quote>event node</quote>. |
|---|
| | 504 | <para> Initialise un nouveau noeud et l'ajoute dans la configuation du |
|---|
| | 505 | cluster existant.</para> |
|---|
| | 506 | |
|---|
| | 507 | <para> Le processus d'initialisation consiste à la création de l'espace |
|---|
| | 508 | de noms sur le nouveau noeud ( la base elle-même doit déjà exister ), |
|---|
| | 509 | charger les tables, les fonctions, les procédures et initialiser le |
|---|
| | 510 | noeud. La configuration existante du reste du noeud est copiée à |
|---|
| | 511 | partir d'un <quote>node d'événement</quote>. |
|---|
| 526 | | <varlistentry><term><literal> SPOOLNODE = boolean </literal></term> |
|---|
| 527 | | |
|---|
| 528 | | <listitem><para>Specifies that the new node is a virtual spool |
|---|
| 529 | | node for file archiving of replication log. If true, |
|---|
| 530 | | <application>slonik</application> will not attempt to |
|---|
| 531 | | initialize a database with the replication |
|---|
| 532 | | schema.</para></listitem> |
|---|
| | 523 | <varlistentry><term><literal> SPOOLNODE = booléen </literal></term> |
|---|
| | 524 | |
|---|
| | 525 | <listitem><para>Spécifie qu'un noeud est un noeud virtuel de récupération |
|---|
| | 526 | pour l'archivage de journaux de réplication. Si ce paramÚtre est à true |
|---|
| | 527 | <application>slonik</application> n'essaiera pas d'initialiser la base de |
|---|
| | 528 | donnée avec le schéma de réplication.</para></listitem> |
|---|
| 549 | | STORE NODE ( ID = 2, COMMENT = 'Node 2'); |
|---|
| 550 | | </programlisting> |
|---|
| 551 | | </refsect1> |
|---|
| 552 | | <refsect1> <title> Locking Behaviour </title> |
|---|
| 553 | | |
|---|
| 554 | | <para> This command creates a new namespace and configures tables |
|---|
| 555 | | therein; no public objects should be locked during the duration of |
|---|
| 556 | | this.</para> |
|---|
| 557 | | </refsect1> |
|---|
| 558 | | <refsect1> <title> Version Information </title> <para> This command |
|---|
| 559 | | was introduced in &slony1; 1.0. The <envar>SPOOLNODE</envar> |
|---|
| 560 | | parameter was introduced in version 1.1, but was vestigal in that |
|---|
| 561 | | version. The described functionality for <envar>SPOOLNODE</envar> |
|---|
| 562 | | arrives in version 1.2. </para> |
|---|
| | 545 | STORE NODE ( ID = 2, COMMENT = 'Noeud 2'); |
|---|
| | 546 | </programlisting> |
|---|
| | 547 | </refsect1> |
|---|
| | 548 | <refsect1> <title> Utilisation de verrous </title> |
|---|
| | 549 | |
|---|
| | 550 | <para> Cette commande crée un nouvel espace de nom et configure les tables |
|---|
| | 551 | à l'intérieur;aucun objets public ne doit être verrouiller |
|---|
| | 552 | pendant l'exécution de cette commade.</para> |
|---|
| | 553 | </refsect1> |
|---|
| | 554 | |
|---|
| | 555 | <refsect1> <title> Note de version </title> |
|---|
| | 556 | <para> Cette commande fut intorduite dans &slony1; 1.0. La paramÚtre <envar>SPOOLNODE</envar> |
|---|
| | 557 | fut intrduit dans la version 1.1, mais n'était pas implémentée dans cette version. |
|---|
| | 558 | La fonctionnalité <envar>SPOOLNODE</envar> est arrivée dans la |
|---|
| | 559 | version 1.2. </para> |
|---|
| 582 | | Drop a node. This command removes the specified node entirely |
|---|
| 583 | | from the replication systems configuration. If the replication |
|---|
| 584 | | daemon is still running on that node (and processing events), it |
|---|
| 585 | | will attempt to uninstall the replication system and terminate |
|---|
| 586 | | itself. |
|---|
| | 579 | Supprime un noeud. Cette commande retire complÚtement le noeud spécifié |
|---|
| | 580 | de la configuration du systÚme de réplication. |
|---|
| | 581 | Si le démon de réplication est toujours en fonctionnement sur ce noeud |
|---|
| | 582 | (et qu'ils traitent les événements), il tentera de désinstaller le systÚme |
|---|
| | 583 | de réplication et s'arrêtera de lui-même. |
|---|
| 599 | | <para> This uses &fundropnode;. </para> |
|---|
| 600 | | |
|---|
| 601 | | <para> When you invoke <command>DROP NODE</command>, one of the |
|---|
| 602 | | steps is to run <command>UNINSTALL NODE</command>.</para> |
|---|
| 603 | | |
|---|
| 604 | | </refsect1> |
|---|
| 605 | | <refsect1><title>Example</title> |
|---|
| | 596 | <para> Cette commande utilise &fundropnode;. </para> |
|---|
| | 597 | |
|---|
| | 598 | <para> Quand vous invoquez <command>DROP NODE</command>, une des étapes |
|---|
| | 599 | consiste à lancer <command>UNINSTALL NODE</command>.</para> |
|---|
| | 600 | |
|---|
| | 601 | </refsect1> |
|---|
| | 602 | <refsect1><title>Exemple</title> |
|---|
| 610 | | <refsect1> <title> Locking Behaviour </title> |
|---|
| 611 | | |
|---|
| 612 | | <para> When dropping triggers off of application tables, this will |
|---|
| 613 | | require exclusive access to each replicated table on the node |
|---|
| 614 | | being discarded.</para> |
|---|
| 615 | | </refsect1> |
|---|
| 616 | | <refsect1><title>Dangerous/Unintuitive Behaviour</title> |
|---|
| 617 | | <para> If you are using connections that cache query plans |
|---|
| 618 | | (this is particularly common for Java application frameworks with |
|---|
| 619 | | connection pools), the connections may cache query plans that |
|---|
| 620 | | include the pre-<command>DROP NODE</command> state of things, and |
|---|
| 621 | | you will get &rmissingoids;.</para> |
|---|
| 622 | | |
|---|
| 623 | | <para>After dropping a node, you may also need to recycle |
|---|
| 624 | | connections in your application.</para> |
|---|
| 625 | | |
|---|
| 626 | | <para> You cannot submit this to an <command>EVENT |
|---|
| 627 | | NODE</command> that is the number of the node being dropped; the |
|---|
| 628 | | request must go to some node that will remain in the |
|---|
| 629 | | cluster. </para> |
|---|
| 630 | | </refsect1> |
|---|
| 631 | | |
|---|
| 632 | | <refsect1> <title> Version Information </title> |
|---|
| 633 | | <para> This command was introduced in &slony1; 1.0 </para> |
|---|
| | 607 | <refsect1> <title> Utilisation de verrous </title> |
|---|
| | 608 | |
|---|
| | 609 | <para> Lorsqu'on supprime des triggers d'une table de l'application, |
|---|
| | 610 | cela nécessite un accÚs exclusif à chaque table répliquée sur le noeud |
|---|
| | 611 | que l'on supprime.</para> |
|---|
| | 612 | </refsect1> |
|---|
| | 613 | <refsect1><title>Comportement dangereux ou non-intuitif</title> |
|---|
| | 614 | <para> Si vous utiliser des connexions qui cachent les plans d'éxécution |
|---|
| | 615 | (ce qui est particuliÚrement commun pour framework applicatifs Java utilisant |
|---|
| | 616 | de pools de connexion pools), les connexions peuvent cacher des plans |
|---|
| | 617 | de reques qui se base sur une vision pré-<command>DROP NODE</command>, |
|---|
| | 618 | ce qui implique que vous obtiendrez des &rmissingoids;.</para> |
|---|
| | 619 | |
|---|
| | 620 | <para>Ainsi aprÚs avoir supprimé un noeud, il est préférable de réinitialiser |
|---|
| | 621 | les connexions de votre applications.</para> |
|---|
| | 622 | |
|---|
| | 623 | <para> Vous ne pouvez pas soumettre cela à un <command>EVENT |
|---|
| | 624 | NODE</command> ayant le même numéro que le noeud que vous supprimez; |
|---|
| | 625 | la requête doit aller vers un noeud qui restera dans le cluster. |
|---|
| | 626 | </para> |
|---|
| | 627 | </refsect1> |
|---|
| | 628 | |
|---|
| | 629 | <refsect1> <title> Note de version </title> |
|---|
| | 630 | <para> Cette commande fut introduite dans &slony1; 1.0 </para> |
|---|