Install Slony
% tar -zxvf slony1.tar.gz
% cd slony1
% ./configure
% make install
Create and Sync Slave database
createdb -O contactuser drupal-4.7.0-beta2_slave
createlang -U postgres -h localhost plpgsql drupal-4.7.0-beta2_slave
pg_dump -s -U postgres -h localhost drupal-4.7.0-beta2 | psql -U postgres -h localhost drupal-4.7.0-beta2_slave
Create a script called "cluster_setup.sh"
#!/bin/sh
CLUSTER=drupal_cluster
DB1=drupal-4.7.0-beta2
DB2=drupal-4.7.0-beta2_slave
H1=localhost
H2=localhost
U=postgres
slonik <<_EOF_
cluster name = $CLUSTER;
node 1 admin conninfo = 'dbname=$DB1 host=$H1 user=$U';
node 2 admin conninfo = 'dbname=$DB2 host=$H2 user=$U';
init cluster (id = 1, comment = 'Node 1');
create set (id = 1, origin = 1,
comment = 'All Drupal Tables');
set add table (set id = 1, origin = 1, id = 1,
full qualified name = 'public.node_revisions',
comment = 'Node_Revision');
set add table (set id = 1, origin = 1, id = 2,full qualified name = 'public.access',comment = 'Access Table');
set add table (set id = 1, origin = 1, id = 3,full qualified name = 'public.accesslog',comment = 'Access Log Table');
set add table (set id = 1, origin = 1, id = 4,full qualified name = 'public.aggregator_category',comment = 'Access Table');
set add table (set id = 1, origin = 1, id = 5,full qualified name = 'public.aggregator_category_feed',comment = 'Access Table');