Mon Nov 12 04:14:19 PST 2007
- Previous message: [Slony1-general] "resume" replication without truncating the tables
- Next message: [Slony1-general] "resume" replication without truncating the tables [SOLVED]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Adam PAPAI a écrit : > Hello List, > > I have a few question on the method of starting/stopping/resuming > replications. > > I have a replication, which is running at the moment. > > The steps I took: > > 1. Created the database on the slave host. > 2. Copied the schema from the original. > 3. Created the plpgsql language on the slave db. > 4. defined the nodes with these scripts: > > # Cluster internal ID > cluster name = $CLUSTER; > > # Connection data > node 1 admin conninfo = 'dbname=$DBNAME1 host=$HOST1 user=$SLONY_USER'; > node 2 admin conninfo = 'dbname=$DBNAME2 host=$HOST2 user=$SLONY_USER'; > > init cluster ( id = 1, comment = 'Node 1' ); > create set ( id = 1, origin = 1, comment = 'All tables' ); > > *snip* table definitions > > store node ( id = 2, comment = 'Node 2' ); > > store path ( server = 1, client = 2, conninfo = 'dbname=$DBNAME1 > host=$HOST1 user=$SLONY_USER'); > > store path ( server = 2, client = 1, conninfo = 'dbname=$DBNAME2 > host=$HOST2 user=$SLONY_USER'); > > store listen ( origin = 1, provider = 1, receiver = 2 ); > store listen ( origin = 2, provider = 2, receiver = 1 ); > > > 5. Started the slon on both hosts: > > master: slon $CLUSTERNAME "dbname=$MASTER_DATABASENAME > user=$MASTER_SLON_USER" > > slave: slon $CLUSTERNAME "dbanme=$SLAVE_DATABASENAME > user=$SLAVE_SLONY_USER" > > 6. Run my start_slony_replication.sh which does the following > > cluster name = $CLUSTER; > node 1 admin conninfo = 'dbname=$DBNAME1 host=$HOST1 user=$SLONY_USER'; > node 2 admin conninfo = 'dbname=$DBNAME2 host=$HOST2 user=$SLONY_USER'; > subscribe set ( id = 1, provider = 1, receiver = 2, forward = no); > > > > At this point, the tables are truncated on the slave machine. Even if > the two database is synced. > > So if I run this script to stop the replication > > cluster name = $CLUSTER; > node 1 admin conninfo = 'dbname=$DBNAME1 host=$HOST1 user=$SLONY_USER'; > node 2 admin conninfo = 'dbname=$DBNAME2 host=$HOST2 user=$SLONY_USER'; > unsubscribe set ( id = 1, receiver = 2 ); > > and start replication again mentioned in point 6. then all of my > tables will be truncated. > > I'd like to awoid this truncate process. I want to move my server to > another place, so I have to stop the replication itself for a few > hours. But the size of the database is greater than 60GB and it takes > too much time to sync again from scratch via pppoe connection and does > not make sense. > > Is it possible to make such a "resume" replication without deleting > all of my data on the slave machine? I want to copy only the "newly > changed data between the stop-restart time interval.". > > Or do I have to use another tool/application which is out of my sight? > > Thanks in advance, any comments are welcome. > > Hi, I wonder why you unsubscribe the set. To stop the replication, you should only stop the slon processes. Restarting them will apply events occured while the slave was stoppped. What's more, there is no way, at the moment, to tell a slave and a master there are in sync prior to run the subscribe set part of the script, i.e. to initiate the replication. Hope that could help. Regards, -- Stéphane SCHILDKNECHT Président de PostgreSQLFr http://www.postgresqlfr.org
- Previous message: [Slony1-general] "resume" replication without truncating the tables
- Next message: [Slony1-general] "resume" replication without truncating the tables [SOLVED]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list