Changeset 937

Show
Ignore:
Timestamp:
03/02/08 18:33:18 (10 months ago)
Author:
daamien
Message:

Merge 1.2.12 > 1.2.13

Files:

Legend:

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

    r932 r937  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<!-- DerniÚre modification 
    3      le       22 février 2008 
    4      par      damien clochard <damien@dalibo.info> 
     3     le       $Date$ 
     4     par      $Author$ 
    55     révision $Revision$ --> 
    66 
     
    245245 
    246246<note><para> In &slony1; version 2.0, <xref linkend= 
    247 "stmttableaddkey"> is <emphasis>no longer supported</emphasis>, and 
    248 thus <xref linkend="stmtuninstallnode"> consists very simply of 
     247"stmttableaddkey"/> is <emphasis>no longer supported</emphasis>, and 
     248thus <xref linkend="stmtuninstallnode"/> consists very simply of 
    249249<command>DROP SCHEMA "_ClusterName" CASCADE;</command>.  </para> 
    250250</note></listitem> 
  • traduc/trunk/slony/adminscripts.xml

    r901 r937  
    639639<subtitle> Apache-Style profiles for FreeBSD <filename>ports/databases/slony/*</filename> </subtitle> 
    640640 
    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 
    642644script that might be used to start up &lslon; instances at the time of 
    643645system startup.  It is designed to interact with the FreeBSD Ports 
    644646system.</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 
     655help create a new node that duplicates one of the ones in the 
     656cluster. </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 
     668specify <function>libpq</function>-style parameters for 
     669<envar>PGHOST</envar>, <envar>PGPORT</envar>, 
     670<envar>PGDATABASE</envar>, and <envar>PGUSER</envar>; it is expected 
     671that <filename>.pgpass</filename> will be used for storage of 
     672passwords, as is generally considered best practice. Those values may 
     673inherit from the <function>libpq</function> environment variables, if 
     674not set, which is useful when using this for testing.  When 
     675<quote>used in anger,</quote> however, it is likely that nearly all of 
     676the 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 
     680that it creates that contain SQL and &lslonik; scripts to set up the 
     681new 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> 
    645704 
    646705</sect2> 
  • traduc/trunk/slony/bestpractices.xml

    r901 r937  
    149149</listitem> 
    150150 
     151<listitem><para> If you are using the autovacuum process in recent 
     152versions of &postgres;, you may wish to leave &slony1; tables out, as 
     153&slony1; is a bit more intelligent about vacuuming when it is expected 
     154to be conspicuously useful (<emphasis>e.g.</emphasis> - immediately 
     155after purging old data) to do so than autovacuum can be. </para> 
     156 
     157<para> See <xref linkend="maintenance-autovac"/> for more 
     158details. </para> </listitem> 
     159 
     160 
    151161<listitem> <para> Running all of the &lslon; daemons on a central 
    152162server for each network has proven preferable. </para> 
     
    230240unique index, which means that &slony1; has introduced a new failure 
    231241mode for your application.</para> 
     242 
     243 
     244<warning><para> In version 2 of &slony1;, <xref 
     245linkend="stmttableaddkey"/> is no longer supported.  You 
     246<emphasis>must</emphasis> have either a true primary key or a 
     247candidate primary key.  </para></warning> 
    232248</listitem> 
    233249 
     
    604620the exact form that the index setup should take. </para>  
    605621 
    606 <para> In 1.2, there is a process that runs automatically to add 
    607 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 
     623automatically to add partial indexes by origin node number, which 
     624should be the optimal form for such an index to take.  </para> 
    609625</listitem> 
    610626 
     
    621637poorly. </para> </listitem> 
    622638 
    623 <listitem><para> Increase the <xref 
     639<listitem><para> Increase the <xrefls 
    624640linkend="slon-config-sync-interval"/> on the origin's <xref 
    625641linkend="slon"/> so that <command>SYNC</command> events are generated 
  • traduc/trunk/slony/defineset.xml

    r901 r937  
    7575key, as it infers the namespace from the table.</para></listitem> 
    7676 
     77 
    7778<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> 
     79you might ask &slony1; to provide one using  
     80<xref linkend="stmttableaddkey"/>.</para> 
     81 
     82<warning><para> <xref linkend="stmttableaddkey"/> was always considered 
     83a <quote>kludge</quote>, at best, and as of version 2.0, it is 
     84considered such a misfeature that it is being removed.  </para> 
     85</warning> 
     86</listitem> 
     87 
    8488 
    8589</itemizedlist> 
     
    123127that will shorten the length of each of the transactions, lessening 
    124128the degree of the <quote>injury</quote> to performance.</para> 
     129 
     130<para> Another issue comes up particularly frequently when replicating 
     131across a WAN; sometimes the network connection is a little bit 
     132unstable, such that there is a risk that a connection held open for 
     133several hours will lead to <command>CONNECTION TIMEOUT.</command> If 
     134that happens when 95% done copying a 50-table replication set 
     135consisting of 250GB of data, that could ruin your whole day.  If the 
     136tables were, instead, associated with separate replication sets, that 
     137failure at the 95% point might only interrupt, temporarily, the 
     138copying of <emphasis>one</emphasis> of those tables.  </para> 
    125139 
    126140<para> These <quote>negative effects</quote> tend to emerge when the 
  • traduc/trunk/slony/failover.xml

    r901 r937  
    5151 
    5252<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> 
     53server requires the application to reconnect to the new database.  So 
     54in order to avoid any complications, we simply shut down the web 
     55server.  Users who use <application>pg_pool</application> for the 
     56applications database connections merely have to shut down the 
     57pool.</para> 
     58 
     59<para> What needs to be done, here, is highly dependent on the way 
     60that the application(s) that use the database are configured.  The 
     61general point is thus: Applications that were connected to the old 
     62database must drop those connections and establish new connections to 
     63the database that has been promoted to the <quote>/master/</quote> role.  There 
     64are a number of ways that this may be configured, and therefore, a 
     65number of possible methods for accomplishing the change: 
     66 
     67<itemizedlist> 
     68 
     69<listitem><para> The application may store the name of the database in 
     70a file.</para> 
     71 
     72<para> In that case, the reconfiguration may require changing the 
     73value in the file, and stopping and restarting the application to get 
     74it 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 
     79record </ulink> that establishes a name for the application to use to 
     80reference the node that is in the <quote>master</quote> role.</para> 
     81 
     82<para> In that case, reconfiguration would require changing the CNAME 
     83to point to the new server, and possibly restarting the application to 
     84refresh database connections. 
     85</para> </listitem> 
     86 
     87<listitem><para> If you are using <application>pg_pool</application> or some 
     88similar <quote>connection pool manager,</quote> then the reconfiguration 
     89involves reconfiguring this management tool, but is otherwise similar 
     90to the DNS/CNAME example above.  </para> </listitem> 
     91 
     92</itemizedlist> 
     93 
     94<para> Whether or not the application that accesses the database needs 
     95to be restarted depends on how it is coded to cope with failed 
     96database connections; if, after encountering an error it tries 
     97re-opening them, then there may be no need to restart it. </para> 
     98 
     99</listitem> 
     100 
    57101 
    58102<listitem><para> A small <xref linkend="slonik"/> script executes the 
  • traduc/trunk/slony/faq.xml

    r901 r937  
    238238</qandaentry> 
    239239 
     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, 
     244where <application>yum</application> was used to install the package 
     245<filename>postgresql-libs.x86_64</filename>, the following complaint 
     246comes up: 
     247 
     248<screen> 
     249configure: 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 
     255newer than 7.3. </para> 
     256</question> 
     257 
     258<answer> <para> <application>configure</application> is looking for 
     259that symbol by compiling a little program that calls for it, and 
     260checking if the compile succeeds.  On the <command>gcc</command> 
     261command line it uses <command>-lpq</command> to search for the 
     262library. </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 
     267libpq.  The <emphasis>true</emphasis> problem is that the compiler failed to 
     268find 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 
     276similar classes of system configuration problems.  Bad symlinks, bad 
     277permissions, bad behaviour on the part of your C compiler, all may 
     278potentially lead to this same error message. </para>  
     279 
     280<para> Thus, if you see this error, you need to look in the log file 
     281that is generated, <filename>config.log</filename>.  Search down to 
     282near the end, and see what the <emphasis>actual</emphasis> complaint 
     283was.  That will be helpful in tracking down the true root cause of the 
     284problem.</para> 
     285</answer> 
     286 
     287</qandaentry> 
     288 
    240289</qandadiv> 
    241290 
     
    421470could also announce an admin to take a look...  </para> </answer> 
    422471 
    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 
    426473 
    427474</qandaentry> 
     
    13361383</answer> </qandaentry> 
    13371384 
     1385<qandaentry> 
     1386 
     1387<question><para> I'm noticing in the logs that a &lslon; is frequently 
     1388switching in and out of <quote>polling</quote> mode as it is 
     1389frequently reporting <quote>LISTEN - switch from polling mode to use 
     1390LISTEN</quote> and <quote>UNLISTEN - switch into polling 
     1391mode</quote>. </para> </question> 
     1392 
     1393<answer><para> The thresholds for switching between these modes are 
     1394controlled by the configuration parameters <xref 
     1395linkend="slon-config-sync-interval"> and <xref 
     1396linkend="slon-config-sync-interval-timeout">; if the timeout value 
     1397(which defaults to 10000, implying 10s) is kept low, that makes it 
     1398easy for the &lslon; to decide to return to <quote>listening</quote> 
     1399mode.  You may want to increase the value of the timeout 
     1400parameter. </para> 
     1401</answer> 
     1402</qandaentry> 
     1403 
     1404 
    13381405</qandadiv> 
    13391406<qandadiv id="faqbugs"> <title> &slony1; FAQ: &slony1; Bugs in Elder Versions </title> 
  • traduc/trunk/slony/filelist.xml

    r901 r937  
    4949<!ENTITY slonyupgrade       SYSTEM "slonyupgrade.xml"> 
    5050<!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"> 
    5254 
    5355<!-- back matter --> 
  • traduc/trunk/slony/firstdb.xml

    r901 r937  
    100100</programlisting> 
    101101 
     102<para> One of the tables created by 
     103<application>pgbench</application>, <envar>history</envar>, does not 
     104have a primary key.  In earlier versions of &slony1;, a &lslonik; 
     105command called <xref linkend="stmttableaddkey"/> could be used to 
     106introduce one.  This caused a number of problems, and so this feature 
     107has been removed in version 2 of &slony1;.  It now 
     108<emphasis>requires</emphasis> that there is a suitable candidate 
     109primary key. </para> 
     110 
     111<para> The following SQL requests will establish a proper primary key on this table: </para> 
     112 
     113<programlisting> 
     114psql -U $PGBENCH_USER -h $HOST1 -d $DBNAME1 -c "begin; alter table 
     115history add column id serial; update history set id = 
     116nextval('history_id_seq'); alter table history add primary key(id); 
     117commit" 
     118</programlisting> 
     119 
    102120<para>Because &slony1; depends on the databases having the pl/pgSQL 
    103121procedural language installed, we better install it now.  It is 
     
    235253        set add table (set id=1, origin=1, id=2, fully qualified name = 'public.branches', comment='branches table'); 
    236254        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'); 
    238256 
    239257        #-- 
  • traduc/trunk/slony/installation.xml

    r901 r937  
    231231indicates that there is intent to address the issue by bumping up the 
    232232value of NAMELEN in some future release of Red Hat Enterprise Linux, 
    233 but that won't likely help you in 2005.  Fedora Core 4 should have the 
     233but that won't likely help you in 2008.  Fedora Core 4 should have the 
    234234issue addressed somewhat sooner. </para> 
    235235 
     
    272272installing any RPM.</para> 
    273273 
    274 <screen>rpm -ivh postgresql-slony1-....rpm</screen> 
     274<screen>rpm -ivh postgresql-slony1-engine-....rpm</screen> 
    275275 
    276276<para>If you want to upgrade the previous version, just use  
     
    283283are installed in <filename>/usr/lib/pgsql</filename>, and finally the 
    284284docs are installed in 
    285 <filename>/usr/share/doc/postgresql-slony1</filename>.</para> 
     285<filename>/usr/share/doc/postgresql-slony1-engine</filename>.</para> 
    286286 
    287287</sect2> 
  • traduc/trunk/slony/legal.xml

    r901 r937  
    66 
    77<copyright> 
    8  <year>2004-2006</year> 
     8 <year>2004-2007</year> 
    99 <holder>The PostgreSQL Global Development Group</holder> 
    1010</copyright> 
     
    1414 
    1515 <para> 
    16   <productname>PostgreSQL</productname> is Copyright &copy; 2004-2006 
     16  <productname>PostgreSQL</productname> is Copyright &copy; 2004-2007 
    1717  by the PostgreSQL Global Development Group and is distributed under 
    1818  the terms of the license of the University of California below. 
  • traduc/trunk/slony/loganalysis.xml

    r901 r937  
    3131</screen></para></sect2> 
    3232 
     33<sect2><title>INFO notices</title> 
     34 
     35<para> Events that take place that seem like they will generally be of 
     36interest are recorded at the INFO level, and, just as with CONFIG 
     37notices, are always listed. </para> 
     38 
     39</sect2> 
     40 
    3341<sect2><title>DEBUG Notices</title> 
    3442 
    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 
     44need 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 
     51which the notice originates. You will see messages from the following 
     52threads:   
    3853 
    3954<variablelist> 
     
    182197<para> This section lists numerous of the error messages found in 
    183198&slony1;, along with a brief explanation of implications.  It is a 
    184 fairly well comprehensive list, leaving out mostly some of 
    185 the <command>DEBUG4</command> messages that are generally 
     199fairly comprehensive list, only eaving out mostly some of 
     200the <command>DEBUG4</command> messages that are almost always 
    186201uninteresting.</para> 
    187202 
     
    10351050<listitem><para><command>WARN: remoteWorkerThread_%d: event %d ignored - origin inactive</command></para>  
    10361051 
    1037 <para> This shouldn't occur now (2006) as we don't support the notion 
     1052<para> This shouldn't occur now (2007) as we don't support the notion 
    10381053of deactivating a node... </para> 
    10391054</listitem> 
  • traduc/trunk/slony/logshipping.xml

    r901 r937  
    275275start transaction; 
    276276 
    277 select "_T1".setsyncTracking_offline(1, '655', '656', '2005-09-23 18:37:40.206342'); 
     277select "_T1".setsyncTracking_offline(1, '655', '656', '2007-09-23 18:37:40.206342'); 
    278278-- end of log archiving header 
    279279</programlisting></para></listitem> 
     
    287287start transaction; 
    288288 
    289 select "_T1".setsyncTracking_offline(1, '96', '109', '2005-09-23 19:01:31.267403'); 
     289select "_T1".setsyncTracking_offline(1, '96', '109', '2007-09-23 19:01:31.267403'); 
    290290-- end of log archiving header 
    291291</programlisting></para> 
     
    349349 
    350350</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 
     358url="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 
     360that 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 
     364against the node that is to be used as a schema source, and it will 
     365list the rules and triggers present on that node that may, in turn 
     366need to be deactivated.</para> 
     367 
     368<para> It includes <function>logtrigger</function> and <function>denyaccess</function> 
     369triggers which will may be left out of the extracted schema, but it is 
     370still worth the Gentle Administrator verifying that such triggers are 
     371kept out of the log shipped replica.</para> 
     372 
     373</sect2> 
     374 
    351375<sect2> <title> <application>slony_logshipper </application> Tool </title> 
    352376 
  • traduc/trunk/slony/maintenance.xml

    r901 r937  
    1717<productname>Slony-I</productname> cluster's namespace, notably 
    1818entries in <xref linkend="table.sl-log-1"/>, <xref 
    19 linkend="table.sl-log-2"/> (not yet used), and <xref 
     19linkend="table.sl-log-2"/>, and <xref 
    2020linkend="table.sl-seqlog"/>.</para></listitem> 
    2121 
     
    3131vacuuming of these tables.  Unfortunately, it has been quite possible 
    3232for <application>pg_autovacuum</application> to not vacuum quite 
    33 frequently enough, so you probably want to use the internal vacuums. 
     33frequently enough, so you may prefer to use the internal vacuums. 
    3434Vacuuming &pglistener; <quote>too often</quote> isn't nearly as 
    3535hazardous as not vacuuming it frequently enough.</para> 
     
    6363</itemizedlist> 
    6464</para> 
     65 
     66 
     67<sect2 id="maintenance-autovac"> <title> Interaction with &postgres; 
     68autovacuum </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 
     74modified, thereby creating dead tuples, and vacuums those tables, 
     75<quote>on demand.</quote> It has been observed that this can interact 
     76somewhat negatively with &slony1;'s own vacuuming policies on its own 
     77tables. </para> 
     78 
     79<para> &slony1; requests vacuums on its tables immediately after 
     80completing transactions that are expected to clean out old data, which 
     81may be expected to be the ideal time to do so.  It appears as though 
     82autovacuum may notice the changes a bit earlier, and attempts 
     83vacuuming when transactions are not complete, rendering the work 
     84pretty useless.  It seems preferable to configure autovacuum to avoid 
     85vacuum &slony1;-managed configuration tables. </para> 
     86 
     87<para> The following query (change the cluster name to match your 
     88local configuration) will identify the tables that autovacuum should 
     89be configured not to process: </para> 
     90 
     91<programlisting> 
     92mycluster=# 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 
     115information: <command> insert into pg_catalog.pg_autovacuum (vacrelid, 
     116enabled) select oid, 'f' from pg_catalog.pg_class where relnamespace = 
     117(select oid from pg_namespace where nspname = '_' || 'MyCluster') and 
     118relhasindex; </command> </para> 
     119</sect2> 
    65120 
    66121<sect2><title> Watchdogs: Keeping Slons Running</title> 
     
    94149<sect2 id="gensync"><title>Parallel to Watchdog: generate_syncs.sh</title> 
    95150 
     151<indexterm><primary>generate SYNCs</primary></indexterm> 
     152 
    96153<para>A new script for &slony1; 1.1 is 
    97154<application>generate_syncs.sh</application>, which addresses the following kind of 
     
    224281<sect2><title> Other Replication Tests </title> 
    225282 
     283<indexterm><primary>testing replication</primary></indexterm>   
     284   
    226285<para> The methodology of the previous section is designed with a view 
    227286to minimizing the cost of submitting replication test queries; on a 
     
    292351</para> 
    293352</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 
     360daemontools.  This uses multilog in a pretty basic way, which seems to 
     361be standard for daemontools / multilog setups. If you want clever 
     362logging, see logrep below. Currently this script has very limited 
     363error handling capabilities.</para> 
     364 
     365<para> For non-interactive use, set the following environment 
     366variables.  <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 
     370asks 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 
     375to 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 
     397you to use multilog filters (by setting the CRITERIA) to create 
     398special purpose log files. The goal is to provide a way to monitor log 
     399files in near realtime for <quote>interesting</quote> data without either 
     400hacking up the initial log file or wasting CPU/IO by re-scanning the 
     401same log repeatedly. 
     402</para> 
     403 
     404<para>For non-interactive use, set the following environment 
     405variables.  <envar>BASEDIR</envar> <envar>SYSUSR</envar> <envar>SOURCE</envar> 
     406<envar>EXTENSION</envar> <envar>CRITERIA</envar> If any of the above are not set, 
     407the 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 
     413to 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 
     421ERROR 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 
     433slon is in the process of handling copies or other subscription activity. 
     434If 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 
     437the middle of initial copies.</para> 
     438 
     439<para> If you happen to be monitoring the mtime of your primary slony logs to  
     440determine if your slon has gone brain-dead, checking this is a good way 
     441to avoid mistakenly clobbering it in the middle of a subscribe. As a bonus, 
     442recall that since the the slons are running under svscan, you only need to 
     443kill it (via the svc interface) and let svscan start it up again laster. 
     444I've also found the COPY logs handy for following subscribe activity  
     445interactively.</para> 
     446</sect3> 
     447 
     448</sect2> 
    294449</sect1> 
  • traduc/trunk/slony/monitoring.xml

    r901 r937  
    100100Options[db_replication_lagtime]: gauge,nopercent,growright 
    101101</programlisting> 
     102 
     103 
     104<para> Alternatively, Ismail Yenigul points out how he managed to 
     105monitor slony using <application>MRTG</application> without installing 
     106<application>SNMPD</application>.</para> 
     107 
     108<para> Here is the mrtg configuration</para> 
     109 
     110<programlisting> 
     111Target[db_replication_lagtime]:`/bin/snmpReplicationLagTime.sh 2` 
     112MaxBytes[db_replication_lagtime]: 400000000 
     113Title[db_replication_lagtime]: db: replication lag time 
     114PageTop[db_replication_lagtime]: &lt;H1&gt;db: replication lag time&lt;/H1&gt; 
     115Options[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 
     124output=`/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"` 
     126echo $output 
     127echo $output 
     128echo  
     129echo 
     130# end of script# 
     131</programlisting> 
     132 
     133 
     134<note><para> MRTG expects four lines from the script, and since there 
     135are only two lines provided, the output must be padded to four 
     136lines. </para> </note> 
     137 
    102138</sect2> 
    103139 
     
    199235<filename>tools</filename>, may be used to generate a cluster summary 
    200236compatible with the popular <ulink url="http://www.mediawiki.org/"> 
    201 MediaWiki </ulink> software. </para> 
     237MediaWiki </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 
     240you have a series of &slony1; clusters, passing in the option 
     241<option>--categories=slony1</option> leads to the MediaWiki instance 
     242generating a category page listing all &slony1; clusters so 
     243categorized on the wiki.  </para> 
    202244 
    203245<para> The gentle user might use the script as follows: </para> 
     
    206248~/logtail.en>         mvs login -d mywiki.example.info -u "Chris Browne" -p `cat ~/.wikipass` -w wiki/index.php                      
    207249Doing login with host: logtail and lang: en 
    208 ~/logtail.en> perl $SLONYHOME/tools/mkmediawiki.pl --host localhost --database slonyregress1 --cluster slony_regress1 > Slony_replication.wiki 
     250~/logtail.en> perl $SLONYHOME/tools/mkmediawiki.pl --host localhost --database slonyregress1 --cluster slony_regress1 --categories=Slony-I > Slony_replication.wiki 
    209251~/logtail.en> mvs commit -m "More sophisticated generated Slony-I cluster docs" Slony_replication.wiki 
    210252Doing commit Slony_replication.wiki with host: logtail and lang: en 
  • traduc/trunk/slony/releasechecklist.xml

    r901 r937  
    5858<filename>configure.ac</filename></para></listitem>  
    5959 
    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>  
    6163 
    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>  
    6367<listitem><para> Run <filename>tools/release_checklist.sh</filename> </para> 
    6468 
     
    7175<listitem><para>PACKAGE_VERSION=REL_1_1_2</para></listitem> 
    7276 
    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> 
    7478 
    7579</itemizedlist> 
     
    101105make all &amp;&amp; make clean</command> but that is a somewhat ugly approach. 
    102106 
    103 </para></listitem>  
     107</para> 
     108<para> Slightly better may be <command> ./configure && make 
     109src/slon/conf-file.c src/slonik/parser.c src/slonik/scan.c </command> 
     110</para> 
     111 
     112</listitem>  
    104113 
    105114<listitem><para> Make sure that generated Makefiles and such from the 
    106115previous step(s) are removed.</para> 
    107116 
    108 <para> <command>make distclean</command> ought to do 
    109 that... </para></listitem> 
     117<para> <command>make distclean</command> will do 
     118that... </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 
     123that suggested that it was needful to delete them. </para> 
     124</listitem> 
    110125 
    111126<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 
    67 
    78  <chapter id="schema" 
     
    1011    <para></para> 
    1112 
    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 number 
    50               </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 subscriber 
    70               </para> 
    71  
    72             </listitem> 
    73           </varlistentry> 
    74  
    75         </variablelist> 
    76  
    77  
    78  
    79  
    80  
    81  
    82  
    83  
    84  
    85  
    86       </para> 
    87     </section> 
    8813 
    8914      <section id="table.sl-config-lock" 
     
    12045 
    12146 
    122               </para> 
    123  
    124               <pa