#!/usr/bin/perl # # slony replication setup # # usage: slony-setup freesideuser use strict; use DBI; use FS::UID qw(adminsuidsetup); use FS::Record qw(dbdef); my $user = shift or die "usage: slony-setup username\n"; adminsuidsetup($user); #--- my $MASTERHOST = '192.168.20.10'; my $SLAVEHOST = '192.168.20.50'; #my $REPLICATIONUSER='pgsql'; my $REPLICATIONUSER='postgres'; #-------- print <tables ) { #next if $table =~ /^sql_/i; print "set add table (set id=1, origin=1, id=". $id++. ", fully qualified name = 'public.$table' );\n"; } print </etc/slony1/freeside/slon.conf <<_EOF_ # Set the cluster name that this instance of slon is running against # default is to read it off the command line cluster_name='freeside' # Set slon's connection info, default is to read it off the command line conn_info='host=localhost port=5432 dbname=freeside user=postgres' _EOF_ /etc/init.d/slony1 start END print <