Changeset 937
- Timestamp:
- 03/02/08 18:33:18 (10 months ago)
- Files:
-
- traduc/trunk/slony/addthings.xml (modified) (2 diffs)
- traduc/trunk/slony/adminscripts.xml (modified) (1 diff)
- traduc/trunk/slony/bestpractices.xml (modified) (4 diffs)
- traduc/trunk/slony/defineset.xml (modified) (2 diffs)
- traduc/trunk/slony/failover.xml (modified) (1 diff)
- traduc/trunk/slony/faq.xml (modified) (3 diffs)
- traduc/trunk/slony/filelist.xml (modified) (1 diff)
- traduc/trunk/slony/firstdb.xml (modified) (2 diffs)
- traduc/trunk/slony/installation.xml (modified) (3 diffs)
- traduc/trunk/slony/legal.xml (modified) (2 diffs)
- traduc/trunk/slony/loganalysis.xml (modified) (3 diffs)
- traduc/trunk/slony/logshipping.xml (modified) (3 diffs)
- traduc/trunk/slony/maintenance.xml (modified) (6 diffs)
- traduc/trunk/slony/monitoring.xml (modified) (3 diffs)
- traduc/trunk/slony/raceconditions.xml (added)
- traduc/trunk/slony/releasechecklist.xml (modified) (3 diffs)
- traduc/trunk/slony/schemadoc.xml (modified) (53 diffs)
- traduc/trunk/slony/slon.xml (modified) (1 diff)
- traduc/trunk/slony/slonconf.xml (modified) (2 diffs)
- traduc/trunk/slony/slonik_ref.xml (modified) (11 diffs)
- traduc/trunk/slony/slony.xml (modified) (3 diffs)
- traduc/trunk/slony/slonyupgrade.xml (modified) (1 diff)
- traduc/trunk/slony/subscribenodes.xml (modified) (1 diff)
- traduc/trunk/slony/supportedplatforms.xml (modified) (2 diffs)
- traduc/trunk/slony/testbed.xml (modified) (1 diff)
- traduc/trunk/slony/triggers.xml (added)
- traduc/trunk/slony/usingslonik.xml (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
traduc/trunk/slony/addthings.xml
r932 r937 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <!-- DerniÚre modification 3 le 22 février 20084 par damien clochard <damien@dalibo.info>3 le $Date$ 4 par $Author$ 5 5 révision $Revision$ --> 6 6 … … 245 245 246 246 <note><para> In &slony1; version 2.0, <xref linkend= 247 "stmttableaddkey" > is <emphasis>no longer supported</emphasis>, and248 thus <xref linkend="stmtuninstallnode" > consists very simply of247 "stmttableaddkey"/> is <emphasis>no longer supported</emphasis>, and 248 thus <xref linkend="stmtuninstallnode"/> consists very simply of 249 249 <command>DROP SCHEMA "_ClusterName" CASCADE;</command>. </para> 250 250 </note></listitem> traduc/trunk/slony/adminscripts.xml
r901 r937 639 639 <subtitle> Apache-Style profiles for FreeBSD <filename>ports/databases/slony/*</filename> </subtitle> 640 640 641 <para> In the tools area, <filename>slon.in-profiles</filename> is a 641 <indexterm><primary> Apache-style profiles for FreeBSD </primary> <secondary>FreeBSD </secondary> </indexterm> 642 643 <para> In the <filename>tools</filename> area, <filename>slon.in-profiles</filename> is a 642 644 script that might be used to start up &lslon; instances at the time of 643 645 system startup. It is designed to interact with the FreeBSD Ports 644 646 system.</para> 647 648 </sect2> 649 650 651 <sect2 id="duplicate-node"> <title> <filename> duplicate-node.sh </filename> </title> 652 <indexterm><primary> duplicating nodes </primary> </indexterm> 653 <para> In the <filename>tools</filename> area, 654 <filename>duplicate-node.sh</filename> is a script that may be used to 655 help create a new node that duplicates one of the ones in the 656 cluster. </para> 657 658 <para> The script expects the following parameters: </para> 659 <itemizedlist> 660 <listitem><para> Cluster name </para> </listitem> 661 <listitem><para> New node number </para> </listitem> 662 <listitem><para> Origin node </para> </listitem> 663 <listitem><para> Node being duplicated </para> </listitem> 664 <listitem><para> New node </para> </listitem> 665 </itemizedlist> 666 667 <para> For each of the nodes specified, the script offers flags to 668 specify <function>libpq</function>-style parameters for 669 <envar>PGHOST</envar>, <envar>PGPORT</envar>, 670 <envar>PGDATABASE</envar>, and <envar>PGUSER</envar>; it is expected 671 that <filename>.pgpass</filename> will be used for storage of 672 passwords, as is generally considered best practice. Those values may 673 inherit from the <function>libpq</function> environment variables, if 674 not set, which is useful when using this for testing. When 675 <quote>used in anger,</quote> however, it is likely that nearly all of 676 the 14 available parameters should be used. </para> 677 678 <para> The script prepares files, normally in 679 <filename>/tmp</filename>, and will report the name of the directory 680 that it creates that contain SQL and &lslonik; scripts to set up the 681 new node. </para> 682 683 <itemizedlist> 684 <listitem><para> <filename> schema.sql </filename> </para> 685 <para> This is drawn from the origin node, and contains the <quote>pristine</quote> database schema that must be applied first.</listitem> 686 <listitem><para> <filename> slonik.preamble </filename> </para> 687 688 <para> This <quote>preamble</quote> is used by the subsequent set of slonik scripts. </para> </listitem> 689 <listitem><para> <filename> step1-storenode.slonik </filename> </para> 690 <para> A &lslonik; script to set up the new node. </para> </listitem> 691 <listitem><para> <filename> step2-storepath.slonik </filename> </para> 692 <para> A &lslonik; script to set up path communications between the provider node and the new node. </para> </listitem> 693 <listitem><para> <filename> step3-subscribe-sets.slonik </filename> </para> 694 <para> A &lslonik; script to request subscriptions for all replications sets.</para> </listitem> 695 </itemizedlist> 696 697 <para> For testing purposes, this is sufficient to get a new node working. The configuration may not necessarily reflect what is desired as a final state:</para> 698 699 <itemizedlist> 700 <listitem><para> Additional communications paths may be desirable in order to have redundancy. </para> </listitem> 701 <listitem><para> It is assumed, in the generated scripts, that the new node should support forwarding; that may not be true. </para> </listitem> 702 <listitem><para> It may be desirable later, after the subscription process is complete, to revise subscriptions. </para> </listitem> 703 </itemizedlist> 645 704 646 705 </sect2> traduc/trunk/slony/bestpractices.xml
r901 r937 149 149 </listitem> 150 150 151 <listitem><para> If you are using the autovacuum process in recent 152 versions of &postgres;, you may wish to leave &slony1; tables out, as 153 &slony1; is a bit more intelligent about vacuuming when it is expected 154 to be conspicuously useful (<emphasis>e.g.</emphasis> - immediately 155 after purging old data) to do so than autovacuum can be. </para> 156 157 <para> See <xref linkend="maintenance-autovac"/> for more 158 details. </para> </listitem> 159 160 151 161 <listitem> <para> Running all of the &lslon; daemons on a central 152 162 server for each network has proven preferable. </para> … … 230 240 unique index, which means that &slony1; has introduced a new failure 231 241 mode for your application.</para> 242 243 244 <warning><para> In version 2 of &slony1;, <xref 245 linkend="stmttableaddkey"/> is no longer supported. You 246 <emphasis>must</emphasis> have either a true primary key or a 247 candidate primary key. </para></warning> 232 248 </listitem> 233 249 … … 604 620 the exact form that the index setup should take. </para> 605 621 606 <para> In 1.2 , there is a process that runs automatically to add607 partial indexes by origin node number, which should be the optimal 608 form for such an index to take. </para>622 <para> In 1.2 and later versions, there is a process that runs 623 automatically to add partial indexes by origin node number, which 624 should be the optimal form for such an index to take. </para> 609 625 </listitem> 610 626 … … 621 637 poorly. </para> </listitem> 622 638 623 <listitem><para> Increase the <xref 639 <listitem><para> Increase the <xrefls 624 640 linkend="slon-config-sync-interval"/> on the origin's <xref 625 641 linkend="slon"/> so that <command>SYNC</command> events are generated traduc/trunk/slony/defineset.xml
r901 r937 75 75 key, as it infers the namespace from the table.</para></listitem> 76 76 77 77 78 <listitem><para> If the table hasn't even got a candidate primary key, 78 you can ask &slony1; to provide one. This is done by first using 79 <xref linkend="stmttableaddkey"/> to add a column populated using a 80 &slony1; sequence, and then having the <xref 81 linkend="stmtsetaddtable"/> include the directive 82 <option>key=serial</option>, to indicate that &slony1;'s own column 83 should be used.</para></listitem> 79 you might ask &slony1; to provide one using 80 <xref linkend="stmttableaddkey"/>.</para> 81 82 <warning><para> <xref linkend="stmttableaddkey"/> was always considered 83 a <quote>kludge</quote>, at best, and as of version 2.0, it is 84 considered such a misfeature that it is being removed. </para> 85 </warning> 86 </listitem> 87 84 88 85 89 </itemizedlist> … … 123 127 that will shorten the length of each of the transactions, lessening 124 128 the degree of the <quote>injury</quote> to performance.</para> 129 130 <para> Another issue comes up particularly frequently when replicating 131 across a WAN; sometimes the network connection is a little bit 132 unstable, such that there is a risk that a connection held open for 133 several hours will lead to <command>CONNECTION TIMEOUT.</command> If 134 that happens when 95% done copying a 50-table replication set 135 consisting of 250GB of data, that could ruin your whole day. If the 136 tables were, instead, associated with separate replication sets, that 137 failure at the 95% point might only interrupt, temporarily, the 138 copying of <emphasis>one</emphasis> of those tables. </para> 125 139 126 140 <para> These <quote>negative effects</quote> tend to emerge when the traduc/trunk/slony/failover.xml
r901 r937 51 51 52 52 <listitem><para> At the time of this writing switchover to another 53 server requires the application to reconnect to the database. So in 54 order to avoid any complications, we simply shut down the web server. 55 Users who use <application>pg_pool</application> for the applications database 56 connections merely have to shut down the pool.</para></listitem> 53 server requires the application to reconnect to the new database. So 54 in order to avoid any complications, we simply shut down the web 55 server. Users who use <application>pg_pool</application> for the 56 applications database connections merely have to shut down the 57 pool.</para> 58 59 <para> What needs to be done, here, is highly dependent on the way 60 that the application(s) that use the database are configured. The 61 general point is thus: Applications that were connected to the old 62 database must drop those connections and establish new connections to 63 the database that has been promoted to the <quote>/master/</quote> role. There 64 are a number of ways that this may be configured, and therefore, a 65 number of possible methods for accomplishing the change: 66 67 <itemizedlist> 68 69 <listitem><para> The application may store the name of the database in 70 a file.</para> 71 72 <para> In that case, the reconfiguration may require changing the 73 value in the file, and stopping and restarting the application to get 74 it to point to the new location. 75 </para> </listitem> 76 77 <listitem><para> A clever usage of DNS might involve creating a CNAME 78 <ulink url="http://www.iana.org/assignments/dns-parameters"> DNS 79 record </ulink> that establishes a name for the application to use to 80 reference the node that is in the <quote>master</quote> role.</para> 81 82 <para> In that case, reconfiguration would require changing the CNAME 83 to point to the new server, and possibly restarting the application to 84 refresh database connections. 85 </para> </listitem> 86 87 <listitem><para> If you are using <application>pg_pool</application> or some 88 similar <quote>connection pool manager,</quote> then the reconfiguration 89 involves reconfiguring this management tool, but is otherwise similar 90 to the DNS/CNAME example above. </para> </listitem> 91 92 </itemizedlist> 93 94 <para> Whether or not the application that accesses the database needs 95 to be restarted depends on how it is coded to cope with failed 96 database connections; if, after encountering an error it tries 97 re-opening them, then there may be no need to restart it. </para> 98 99 </listitem> 100 57 101 58 102 <listitem><para> A small <xref linkend="slonik"/> script executes the traduc/trunk/slony/faq.xml
r901 r937 238 238 </qandaentry> 239 239 240 <qandaentry> 241 <question> <para> Problem building on Fedora/x86-64 </para> 242 243 <para> When trying to configure &slony1; on a Fedora x86-64 system, 244 where <application>yum</application> was used to install the package 245 <filename>postgresql-libs.x86_64</filename>, the following complaint 246 comes up: 247 248 <screen> 249 configure: error: Your version of libpq doesn't have PQunescapeBytea 250 this means that your version of PostgreSQL is lower than 7.3 251 and thus not supported by Slony-I. 252 </screen></para> 253 254 <para> This happened with &postgres; 8.2.5, which is certainly rather 255 newer than 7.3. </para> 256 </question> 257 258 <answer> <para> <application>configure</application> is looking for 259 that symbol by compiling a little program that calls for it, and 260 checking if the compile succeeds. On the <command>gcc</command> 261 command line it uses <command>-lpq</command> to search for the 262 library. </para> 263 264 <para> Unfortunately, that package is missing a symlink, from 265 <filename>/usr/lib64/libpq.so</filename> to 266 <filename>libpq.so.5.0</filename>; that is why it fails to link to 267 libpq. The <emphasis>true</emphasis> problem is that the compiler failed to 268 find a library to link to, not that libpq lacked the function call. 269 </para> 270 271 <para> Eventually, this should be addressed by those that manage the 272 <filename>postgresql-libs.x86_64</filename> package. </para> 273 </answer> 274 275 <answer> <para> Note that this same symptom can be the indication of 276 similar classes of system configuration problems. Bad symlinks, bad 277 permissions, bad behaviour on the part of your C compiler, all may 278 potentially lead to this same error message. </para> 279 280 <para> Thus, if you see this error, you need to look in the log file 281 that is generated, <filename>config.log</filename>. Search down to 282 near the end, and see what the <emphasis>actual</emphasis> complaint 283 was. That will be helpful in tracking down the true root cause of the 284 problem.</para> 285 </answer> 286 287 </qandaentry> 288 240 289 </qandadiv> 241 290 … … 421 470 could also announce an admin to take a look... </para> </answer> 422 471 423 <answer><para> As of &postgres; 8.3, this should no longer be an 424 issue, as this version has code which invalidates query plans when 425 tables are altered. </para> </answer> 472 426 473 427 474 </qandaentry> … … 1336 1383 </answer> </qandaentry> 1337 1384 1385 <qandaentry> 1386 1387 <question><para> I'm noticing in the logs that a &lslon; is frequently 1388 switching in and out of <quote>polling</quote> mode as it is 1389 frequently reporting <quote>LISTEN - switch from polling mode to use 1390 LISTEN</quote> and <quote>UNLISTEN - switch into polling 1391 mode</quote>. </para> </question> 1392 1393 <answer><para> The thresholds for switching between these modes are 1394 controlled by the configuration parameters <xref 1395 linkend="slon-config-sync-interval"> and <xref 1396 linkend="slon-config-sync-interval-timeout">; if the timeout value 1397 (which defaults to 10000, implying 10s) is kept low, that makes it 1398 easy for the &lslon; to decide to return to <quote>listening</quote> 1399 mode. You may want to increase the value of the timeout 1400 parameter. </para> 1401 </answer> 1402 </qandaentry> 1403 1404 1338 1405 </qandadiv> 1339 1406 <qandadiv id="faqbugs"> <title> &slony1; FAQ: &slony1; Bugs in Elder Versions </title> traduc/trunk/slony/filelist.xml
r901 r937 49 49 <!ENTITY slonyupgrade SYSTEM "slonyupgrade.xml"> 50 50 <!ENTITY releasechecklist SYSTEM "releasechecklist.xml"> 51 <!ENTITY partitioning SYSTEM "partitioning.xml"> 51 <!ENTITY raceconditions SYSTEM "raceconditions.sgml"> 52 <!ENTITY partitioning SYSTEM "partitioning.sgml"> 53 <!ENTITY triggers SYSTEM "triggers.sgml"> 52 54 53 55 <!-- back matter --> traduc/trunk/slony/firstdb.xml
r901 r937 100 100 </programlisting> 101 101 102 <para> One of the tables created by 103 <application>pgbench</application>, <envar>history</envar>, does not 104 have a primary key. In earlier versions of &slony1;, a &lslonik; 105 command called <xref linkend="stmttableaddkey"/> could be used to 106 introduce one. This caused a number of problems, and so this feature 107 has been removed in version 2 of &slony1;. It now 108 <emphasis>requires</emphasis> that there is a suitable candidate 109 primary key. </para> 110 111 <para> The following SQL requests will establish a proper primary key on this table: </para> 112 113 <programlisting> 114 psql -U $PGBENCH_USER -h $HOST1 -d $DBNAME1 -c "begin; alter table 115 history add column id serial; update history set id = 116 nextval('history_id_seq'); alter table history add primary key(id); 117 commit" 118 </programlisting> 119 102 120 <para>Because &slony1; depends on the databases having the pl/pgSQL 103 121 procedural language installed, we better install it now. It is … … 235 253 set add table (set id=1, origin=1, id=2, fully qualified name = 'public.branches', comment='branches table'); 236 254 set add table (set id=1, origin=1, id=3, fully qualified name = 'public.tellers', comment='tellers table'); 237 set add table (set id=1, origin=1, id=4, fully qualified name = 'public.history', comment='history table' , key = serial);255 set add table (set id=1, origin=1, id=4, fully qualified name = 'public.history', comment='history table'); 238 256 239 257 #-- traduc/trunk/slony/installation.xml
r901 r937 231 231 indicates that there is intent to address the issue by bumping up the 232 232 value of NAMELEN in some future release of Red Hat Enterprise Linux, 233 but that won't likely help you in 200 5. Fedora Core 4 should have the233 but that won't likely help you in 2008. Fedora Core 4 should have the 234 234 issue addressed somewhat sooner. </para> 235 235 … … 272 272 installing any RPM.</para> 273 273 274 <screen>rpm -ivh postgresql-slony1- ....rpm</screen>274 <screen>rpm -ivh postgresql-slony1-engine-....rpm</screen> 275 275 276 276 <para>If you want to upgrade the previous version, just use … … 283 283 are installed in <filename>/usr/lib/pgsql</filename>, and finally the 284 284 docs are installed in 285 <filename>/usr/share/doc/postgresql-slony1 </filename>.</para>285 <filename>/usr/share/doc/postgresql-slony1-engine</filename>.</para> 286 286 287 287 </sect2> traduc/trunk/slony/legal.xml
r901 r937 6 6 7 7 <copyright> 8 <year>2004-200 6</year>8 <year>2004-2007</year> 9 9 <holder>The PostgreSQL Global Development Group</holder> 10 10 </copyright> … … 14 14 15 15 <para> 16 <productname>PostgreSQL</productname> is Copyright © 2004-200 616 <productname>PostgreSQL</productname> is Copyright © 2004-2007 17 17 by the PostgreSQL Global Development Group and is distributed under 18 18 the terms of the license of the University of California below. traduc/trunk/slony/loganalysis.xml
r901 r937 31 31 </screen></para></sect2> 32 32 33 <sect2><title>INFO notices</title> 34 35 <para> Events that take place that seem like they will generally be of 36 interest are recorded at the INFO level, and, just as with CONFIG 37 notices, are always listed. </para> 38 39 </sect2> 40 33 41 <sect2><title>DEBUG Notices</title> 34 42 35 <para>Debug notices are always prefaced by the name of the thread that 36 the notice originates from. You will see messages from the following 37 threads: 43 <para>Debug notices are of less interest, and will quite likely only 44 need to be shown if you are running into some problem with &slony1;.</para> 45 46 </sect2> 47 48 <sect2><title>Thread name </title> 49 50 <para> Notices are always prefaced by the name of the thread from 51 which the notice originates. You will see messages from the following 52 threads: 38 53 39 54 <variablelist> … … 182 197 <para> This section lists numerous of the error messages found in 183 198 &slony1;, along with a brief explanation of implications. It is a 184 fairly well comprehensive list, leaving out mostly some of185 the <command>DEBUG4</command> messages that are generally199 fairly comprehensive list, only eaving out mostly some of 200 the <command>DEBUG4</command> messages that are almost always 186 201 uninteresting.</para> 187 202 … … 1035 1050 <listitem><para><command>WARN: remoteWorkerThread_%d: event %d ignored - origin inactive</command></para> 1036 1051 1037 <para> This shouldn't occur now (200 6) as we don't support the notion1052 <para> This shouldn't occur now (2007) as we don't support the notion 1038 1053 of deactivating a node... </para> 1039 1054 </listitem> traduc/trunk/slony/logshipping.xml
r901 r937 275 275 start transaction; 276 276 277 select "_T1".setsyncTracking_offline(1, '655', '656', '200 5-09-23 18:37:40.206342');277 select "_T1".setsyncTracking_offline(1, '655', '656', '2007-09-23 18:37:40.206342'); 278 278 -- end of log archiving header 279 279 </programlisting></para></listitem> … … 287 287 start transaction; 288 288 289 select "_T1".setsyncTracking_offline(1, '96', '109', '200 5-09-23 19:01:31.267403');289 select "_T1".setsyncTracking_offline(1, '96', '109', '2007-09-23 19:01:31.267403'); 290 290 -- end of log archiving header 291 291 </programlisting></para> … … 349 349 350 350 </sect2> 351 352 <sect2><title> <application> find-triggers-to-deactivate.sh 353 </application> </title> 354 355 <indexterm><primary> trigger deactivation </primary> </indexterm> 356 357 <para> It was once pointed out (<ulink 358 url="http://www.slony.info/bugzilla/show_bug.cgi?id=19"> Bugzilla bug 359 #19</ulink>) that the dump of a schema may include triggers and rules 360 that you may not wish to have running on the log shipped node.</para> 361 362 <para> The tool <filename> tools/find-triggers-to-deactivate.sh 363 </filename> was created to assist with this task. It may be run 364 against the node that is to be used as a schema source, and it will 365 list the rules and triggers present on that node that may, in turn 366 need to be deactivated.</para> 367 368 <para> It includes <function>logtrigger</function> and <function>denyaccess</function> 369 triggers which will may be left out of the extracted schema, but it is 370 still worth the Gentle Administrator verifying that such triggers are 371 kept out of the log shipped replica.</para> 372 373 </sect2> 374 351 375 <sect2> <title> <application>slony_logshipper </application> Tool </title> 352 376 traduc/trunk/slony/maintenance.xml
r901 r937 17 17 <productname>Slony-I</productname> cluster's namespace, notably 18 18 entries in <xref linkend="table.sl-log-1"/>, <xref 19 linkend="table.sl-log-2"/> (not yet used), and <xref19 linkend="table.sl-log-2"/>, and <xref 20 20 linkend="table.sl-seqlog"/>.</para></listitem> 21 21 … … 31 31 vacuuming of these tables. Unfortunately, it has been quite possible 32 32 for <application>pg_autovacuum</application> to not vacuum quite 33 frequently enough, so you probably wantto use the internal vacuums.33 frequently enough, so you may prefer to use the internal vacuums. 34 34 Vacuuming &pglistener; <quote>too often</quote> isn't nearly as 35 35 hazardous as not vacuuming it frequently enough.</para> … … 63 63 </itemizedlist> 64 64 </para> 65 66 67 <sect2 id="maintenance-autovac"> <title> Interaction with &postgres; 68 autovacuum </title> 69 70 <indexterm><primary>autovacuum interaction</primary></indexterm> 71 72 <para> Recent versions of &postgres; support an 73 <quote>autovacuum</quote> process which notices when tables are 74 modified, thereby creating dead tuples, and vacuums those tables, 75 <quote>on demand.</quote> It has been observed that this can interact 76 somewhat negatively with &slony1;'s own vacuuming policies on its own 77 tables. </para> 78 79 <para> &slony1; requests vacuums on its tables immediately after 80 completing transactions that are expected to clean out old data, which 81 may be expected to be the ideal time to do so. It appears as though 82 autovacuum may notice the changes a bit earlier, and attempts 83 vacuuming when transactions are not complete, rendering the work 84 pretty useless. It seems preferable to configure autovacuum to avoid 85 vacuum &slony1;-managed configuration tables. </para> 86 87 <para> The following query (change the cluster name to match your 88 local configuration) will identify the tables that autovacuum should 89 be configured not to process: </para> 90 91 <programlisting> 92 mycluster=# select oid, relname from pg_class where relnamespace = (select oid from pg_namespace where nspname = '_' || 'MyCluster') and relhasindex; 93 oid | relname 94 -------+-------------- 95 17946 | sl_nodelock 96 17963 | sl_setsync 97 17994 | sl_trigger 98 17980 | sl_table 99 18003 | sl_sequence 100 17937 | sl_node 101 18034 | sl_listen 102 18017 | sl_path 103 18048 | sl_subscribe 104 17951 | sl_set 105 18062 | sl_event 106 18069 | sl_confirm 107 18074 | sl_seqlog 108 18078 | sl_log_1 109 18085 | sl_log_2 110 (15 rows) 111 </programlisting> 112 113 <para> The following query will populate 114 <envar>pg_catalog.pg_autovacuum</envar> with suitable configuration 115 information: <command> insert into pg_catalog.pg_autovacuum (vacrelid, 116 enabled) select oid, 'f' from pg_catalog.pg_class where relnamespace = 117 (select oid from pg_namespace where nspname = '_' || 'MyCluster') and 118 relhasindex; </command> </para> 119 </sect2> 65 120 66 121 <sect2><title> Watchdogs: Keeping Slons Running</title> … … 94 149 <sect2 id="gensync"><title>Parallel to Watchdog: generate_syncs.sh</title> 95 150 151 <indexterm><primary>generate SYNCs</primary></indexterm> 152 96 153 <para>A new script for &slony1; 1.1 is 97 154 <application>generate_syncs.sh</application>, which addresses the following kind of … … 224 281 <sect2><title> Other Replication Tests </title> 225 282 283 <indexterm><primary>testing replication</primary></indexterm> 284 226 285 <para> The methodology of the previous section is designed with a view 227 286 to minimizing the cost of submitting replication test queries; on a … … 292 351 </para> 293 352 </sect2> 353 354 <sect2><title>mkservice </title> 355 <indexterm><primary>mkservice for BSD </primary></indexterm> 356 357 <sect3><title>slon-mkservice.sh</title> 358 359 <para> Create a slon service directory for use with svscan from 360 daemontools. This uses multilog in a pretty basic way, which seems to 361 be standard for daemontools / multilog setups. If you want clever 362 logging, see logrep below. Currently this script has very limited 363 error handling capabilities.</para> 364 365 <para> For non-interactive use, set the following environment 366 variables. <envar>BASEDIR</envar> <envar>SYSUSR</envar> 367 <envar>PASSFILE</envar> <envar>DBUSER</envar> <envar>HOST</envar> 368 <envar>PORT</envar> <envar>DATABASE</envar> <envar>CLUSTER</envar> 369 <envar>SLON_BINARY</envar> If any of the above are not set, the script 370 asks for configuration information interactively.</para> 371 372 <itemizedlist> 373 <listitem><para> 374 <envar>BASEDIR</envar> where you want the service directory structure for the slon 375 to be created. This should <emphasis>not</emphasis> be the <filename>/var/service</filename> directory.</para></listitem> 376 <listitem><para> 377 <envar>SYSUSR</envar> the unix user under which the slon (and multilog) process should run.</para></listitem> 378 <listitem><para> 379 <envar>PASSFILE</envar> location of the <filename>.pgpass</filename> file to be used. (default <filename>~sysusr/.pgpass</filename>)</para></listitem> 380 <listitem><para> 381 <envar>DBUSER</envar> the postgres user the slon should connect as (default slony)</para></listitem> 382 <listitem><para> 383 <envar>HOST</envar> what database server to connect to (default localhost)</para></listitem> 384 <listitem><para> 385 <envar>PORT</envar> what port to connect to (default 5432)</para></listitem> 386 <listitem><para> 387 <envar>DATABASE</envar> which database to connect to (default dbuser)</para></listitem> 388 <listitem><para> 389 <envar>CLUSTER</envar> the name of your Slony1 cluster? (default database)</para></listitem> 390 <listitem><para> 391 <envar>SLON_BINARY</envar> the full path name of the slon binary (default <command>which slon</command>)</para></listitem> 392 </itemizedlist> 393 394 <sect3><title>logrep-mkservice.sh</title> 395 396 <para>This uses <command>tail -F</command> to pull data from log files allowing 397 you to use multilog filters (by setting the CRITERIA) to create 398 special purpose log files. The goal is to provide a way to monitor log 399 files in near realtime for <quote>interesting</quote> data without either 400 hacking up the initial log file or wasting CPU/IO by re-scanning the 401 same log repeatedly. 402 </para> 403 404 <para>For non-interactive use, set the following environment 405 variables. <envar>BASEDIR</envar> <envar>SYSUSR</envar> <envar>SOURCE</envar> 406 <envar>EXTENSION</envar> <envar>CRITERIA</envar> If any of the above are not set, 407 the script asks for configuration information interactively. 408 </para> 409 410 <itemizedlist> 411 <listitem><para> 412 <envar>BASEDIR</envar> where you want the service directory structure for the logrep 413 to be created. This should <emphasis>not</emphasis> be the <filename>/var/service</filename> directory.</para></listitem> 414 <listitem><para><envar>SYSUSR</envar> unix user under which the service should run.</para></listitem> 415 <listitem><para><envar>SOURCE</envar> name of the service with the log you want to follow.</para></listitem> 416 <listitem><para><envar>EXTENSION</envar> a tag to differentiate this logrep from others using the same source.</para></listitem> 417 <listitem><para><envar>CRITERIA</envar> the multilog filter you want to use.</para></listitem> 418 </itemizedlist> 419 420 <para> A trivial example of this would be to provide a log file of all slon 421 ERROR messages which could be used to trigger a nagios alarm. 422 <command>EXTENSION='ERRORS'</command> 423 <command>CRITERIA="'-*' '+* * ERROR*'"</command> 424 (Reset the monitor by rotating the log using <command>svc -a $svc_dir</command>) 425 </para> 426 427 <para> A more interesting application is a subscription progress log. 428 <command>EXTENSION='COPY'</command> 429 <command>CRITERIA="'-*' '+* * ERROR*' '+* * WARN*' '+* * CONFIG enableSubscription*' '+* * DEBUG2 remoteWorkerThread_* prepare to copy table*' '+* * DEBUG2 remoteWorkerThread_* all tables for set * found on subscriber*' '+* * DEBUG2 remoteWorkerThread_* copy*' '+* * DEBUG2 remoteWorkerThread_* Begin COPY of table*' '+* * DEBUG2 remoteWorkerThread_* * bytes copied for table*' '+* * DEBUG2 remoteWorkerThread_* * seconds to*' '+* * DEBUG2 remoteWorkerThread_* set last_value of sequence*' '+* * DEBUG2 remoteWorkerThread_* copy_set*'"</command> 430 </para> 431 432 <para>If you have a subscription log then it's easy to determine if a given 433 slon is in the process of handling copies or other subscription activity. 434 If the log isn't empty, and doesn't end with a 435 <command>"CONFIG enableSubscription: sub_set:1"</command> 436 (or whatever set number you've subscribed) then the slon is currently in 437 the middle of initial copies.</para> 438 439 <para> If you happen to be monitoring the mtime of your primary slony logs to 440 determine if your slon has gone brain-dead, checking this is a good way 441 to avoid mistakenly clobbering it in the middle of a subscribe. As a bonus, 442 recall that since the the slons are running under svscan, you only need to 443 kill it (via the svc interface) and let svscan start it up again laster. 444 I've also found the COPY logs handy for following subscribe activity 445 interactively.</para> 446 </sect3> 447 448 </sect2> 294 449 </sect1> traduc/trunk/slony/monitoring.xml
r901 r937 100 100 Options[db_replication_lagtime]: gauge,nopercent,growright 101 101 </programlisting> 102 103 104 <para> Alternatively, Ismail Yenigul points out how he managed to 105 monitor slony using <application>MRTG</application> without installing 106 <application>SNMPD</application>.</para> 107 108 <para> Here is the mrtg configuration</para> 109 110 <programlisting> 111 Target[db_replication_lagtime]:`/bin/snmpReplicationLagTime.sh 2` 112 MaxBytes[db_replication_lagtime]: 400000000 113 Title[db_replication_lagtime]: db: replication lag time 114 PageTop[db_replication_lagtime]: <H1>db: replication lag time</H1> 115 Options[db_replication_lagtime]: gauge,nopercent,growright 116 </programlisting> 117 118 <para> and here is the modified version of the script</para> 119 120 <programlisting> 121 # cat /bin/snmpReplicationLagTime.sh 122 #!/bin/bash 123 124 output=`/usr/bin/psql -U slony -h 192.168.1.1 -d endersysecm -qAt -c 125 "select cast(extract(epoch from st_lag_time) as int8) FROM _mycluster.sl_status WHERE st_received = $1"` 126 echo $output 127 echo $output 128 echo 129 echo 130 # end of script# 131 </programlisting> 132 133 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> 137 102 138 </sect2> 103 139 … … 199 235 <filename>tools</filename>, may be used to generate a cluster summary 200 236 compatible with the popular <ulink url="http://www.mediawiki.org/"> 201 MediaWiki </ulink> software. </para> 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> 202 244 203 245 <para> The gentle user might use the script as follows: </para> … … 206 248 ~/logtail.en> mvs login -d mywiki.example.info -u "Chris Browne" -p `cat ~/.wikipass` -w wiki/index.php 207 249 Doing login with host: logtail and lang: en 208 ~/logtail.en> perl $SLONYHOME/tools/mkmediawiki.pl --host localhost --database slonyregress1 --cluster slony_regress1 > Slony_replication.wiki250 ~/logtail.en> perl $SLONYHOME/tools/mkmediawiki.pl --host localhost --database slonyregress1 --cluster slony_regress1 --categories=Slony-I > Slony_replication.wiki 209 251 ~/logtail.en> mvs commit -m "More sophisticated generated Slony-I cluster docs" Slony_replication.wiki 210 252 Doing commit Slony_replication.wiki with host: logtail and lang: en traduc/trunk/slony/releasechecklist.xml
r901 r937 58 58 <filename>configure.ac</filename></para></listitem> 59 59 60 <listitem><para>Purge directory <filename>autom4te.cache</filename> so it is not included in the build </para></listitem> 60 <listitem><para>Purge directory <filename>autom4te.cache</filename> so it is not included in the build </para> 61 <para> Does not need to be done by hand - the later <command> make distclean </command> step does this for you. </para> 62 </listitem> 61 63 62 <listitem><para>Purge out .cvsignore files; this can be done with the command <command> find . -name .cvsignore | xargs rm </command> </para></listitem> 64 <listitem><para>Purge out .cvsignore files; this can be done with the command <command> find . -name .cvsignore | xargs rm </command> </para> 65 <para> Does not need to be done by hand - the later <command> make distclean </command> step does this for you. </para> 66 </listitem> 63 67 <listitem><para> Run <filename>tools/release_checklist.sh</filename> </para> 64 68 … … 71 75 <listitem><para>PACKAGE_VERSION=REL_1_1_2</para></listitem> 72 76 73 <listitem><para>PACKAGE_STRING=postgresql-slony1 REL_1_1_2</para></listitem>77 <listitem><para>PACKAGE_STRING=postgresql-slony1-engine REL_1_1_2</para></listitem> 74 78 75 79 </itemizedlist> … … 101 105 make all && make clean</command> but that is a somewhat ugly approach. 102 106 103 </para></listitem> 107 </para> 108 <para> Slightly better may be <command> ./configure && make 109 src/slon/conf-file.c src/slonik/parser.c src/slonik/scan.c </command> 110 </para> 111 112 </listitem> 104 113 105 114 <listitem><para> Make sure that generated Makefiles and such from the 106 115 previous step(s) are removed.</para> 107 116 108 <para> <command>make distclean</command> ought to do 109 that... </para></listitem> 117 <para> <command>make distclean</command> will do 118 that... </para> 119 120 <para> Note that <command>make distclean</command> also clears out 121 <filename>.cvsignore</filename> files and 122 <filename>autom4te.cache</filename>, thus obsoleting some former steps 123 that suggested that it was needful to delete them. </para> 124 </listitem> 110 125 111 126 <listitem><para>Generate HTML tarball, and RTF/PDF, if traduc/trunk/slony/schemadoc.xml
r901 r937 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- DerniÚre modification 3 le $Date$ 4 par $Author$ 5 révision $Revision$ --> 1 <!-- $Header: /slony1/slony1-engine/doc/adminguide/schemadoc.xml,v 1.7 2006-07-31 18:56:24 cbbrowne Exp $ --> 2 3 4 5 6 6 7 7 8 <chapter id="schema" … … 10 11 <para></para> 11 12 12 13 <section id="table.sl-archive-counter"14 xreflabel="sl_archive_counter">15 <title id="table.sl-archive-counter-title">16 Table:17 18 <structname>sl_archive_counter</structname>19 </title>20 21 22 <para>23 Table used to generate the log shipping archive number.24 25 </para>26 27 28 <para>29 <variablelist>30 <title>31 Structure of <structname>sl_archive_counter</structname>32 </title>33 34 35 <varlistentry>36 <term><structfield>ac_num</structfield></term>37 <listitem><para>38 <type>bigint</type>39 40 41 42 43 44 45 46 </para>47 48 <para>49 Counter of SYNC ID used in log shipping as the archive number50 </para>51 52 </listitem>53 </varlistentry>54 55 <varlistentry>56 <term><structfield>ac_timestamp</structfield></term>57 <listitem><para>58 <type>timestamp without time zone</type>59 60 61 62 63 64 65 66 </para>67 68 <para>69 Time at which the archive log was generated on the subscriber70 </para>71 72 </listitem>73 </varlistentry>74 75 </variablelist>76 77 78 79 80 81 82 83 84 85 86 </para>87 </section>88 13 89 14 <section id="table.sl-config-lock" … … 120 45 121 46 122 </para>123 124 <pa

