Raymond O'Donnell rod at iol.ie
Thu Feb 17 07:43:16 PST 2011
On 17/02/2011 15:03, Tech Madhu wrote:
> all,
> i got the failover to work.. listing the steps which might be useful for
> other beginners like me
>
> node1 = master, node2=slave
>
> node1 goes down (crash or power failure). while node1 is being
> recovered, if your apps have to continue writing to DB, only way i found
> is that we have to do the failover
>
> on node 2, run the following slonik commands
>       1) failover (id = 1, backup node = 2); (this works only if you
> subscribed your set originally with forward=yes)
>       2) ensure DB can be written into (not readonly anymore)
>       3) drop node (id = 1, event node = 2);
> on node 1, run the following commands once it comes back in service
>        1) dropdb <dbname>
>         2) createdb -O <dbuser> <dbname>
>         3) psql -U user -d DB < backup.sql
>        //Note : this backup.sql should not have slony tables, so its
> backup taken before slony was setup using pg_dump -c -s -U <user> <db> >
> backup.sql

It's worth adding here that all you're restoring at this point in the 
procedure is the database schema, not the data. I know it's implicit in 
the pg_dump command above, but I reckon it's worth saying it clearly.

Ray.


-- 
Raymond O'Donnell :: Galway :: Ireland
rod at iol.ie


More information about the Slony1-general mailing list