X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fslony-setup;h=0798c1a038ca16ea4f2b18eb2dd0e159077dc4d1;hp=b384bb9f7db2e0fead6807ca042c818ffe134812;hb=e638cca7c5be9bc9b98eabbf41babc2e58671aac;hpb=7dcd1cecac6d96e98b834f698b0c0656a186525b 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 <