From 6e6188dd4c3956652f2da27fe3cd0ebf30bd31aa Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 6 Mar 2007 19:56:41 +0000 Subject: [PATCH] slight update for slony setup script --- bin/slony-setup | 76 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/bin/slony-setup b/bin/slony-setup index b384bb9f7..0798c1a03 100755 --- a/bin/slony-setup +++ b/bin/slony-setup @@ -1,35 +1,56 @@ #!/usr/bin/perl # -# hack to update/add read-only permissions for a user on the db -# -# usage: pg-readonly freesideuser readonlyuser +# 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; +my $user = shift or die "usage: slony-setup username\n"; adminsuidsetup($user); #--- -#su postgres -c 'createlang plpgsql freeside' - -#--- - -my $MASTERHOST = '172.21.0.204'; -my $SLAVEHOST = '172.21.0.205'; +my $MASTERHOST = '192.168.20.10'; +my $SLAVEHOST = '192.168.20.50'; #my $REPLICATIONUSER='pgsql'; my $REPLICATIONUSER='postgres'; +#-------- + +print <tables ) { } 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 <