Wed Mar 12 08:03:52 PDT 2008
- Previous message: [Slony1-general] UTF-8 encoding Error
- Next message: [Slony1-general] Slave upgrade without break replication
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all,
I have a slony cluster of 4 nodes (3 slaves).
My master database is about 180Gb (df on /data directory).
All server are on postgresql 8.1.xx. But I wanted to upgrade one of
those slave server to postgresql 8.3.
So I had made a test upgrade of postgresql on this slave server
WITHOUT remove/adding node from replication.
I follow this procedure:
On master:
=> I had dump entire schema
On slave
=> Stop slony on this slave
=> Modify access (pg_hab.conf) to be sure that I will be the only one who access...
=> I had dump all data without schema
=> I dump on a separate file data from slony schema
=> Stop postgresql 8.1 and install postgresql 8.3 (and slony)
=> initdb start (without slony) and create the database
=> Import schema (from master)
=> Import data from slony scheme (from my separate file...)
=> run those query:
-- update all oid table/sequences on sl_table/sl_sequence
UPDATE _cluster_xxx.sl_table set tab_reloid=c.oid from pg_class c join
pg_namespace n on (n.oid = c.relnamespace) where
nspname||'.'||relname=tab_nspname||'.'||tab_relname;
UPDATE _cluster_xxx.sl_sequence set seq_reloid=c.oid from pg_class c
join pg_namespace n on (n.oid = c.relnamespace) where
nspname||'.'||relname=seq_nspname||'.'||seq_relname;
-- mark all table as non altered on slave:
UPDATE _cluster_xxx.sl_table set tab_altered = false;
-- Alter all table (adding slony's deny trigger, disable of all existing triggers/contraint)
select _cluster_mxm.altertableforreplication(tab_id) from _cluster_xxx.sl_table;
=> Remove all data on slony's table
truncate _cluster_xxx.sl_* ...
=> Then I import all data:
I start a new psql session
-- Setting session role as slon to allow write on protected tables
select _cluster_mxm.setsessionrole('_cluster_mxm','slon');
-- Importing data
begin;
\i data.sql
commit;
=> Reupdate oid on slony tables/sequences
UPDATE _cluster_xxx.sl_table set tab_reloid=c.oid from pg_class c join
pg_namespace n on (n.oid = c.relnamespace) where
nspname||'.'||relname=tab_nspname||'.'||tab_relname;
UPDATE _cluster_xxx.sl_sequence set seq_reloid=c.oid from pg_class c
join pg_namespace n on (n.oid = c.relnamespace) where
nspname||'.'||relname=seq_nspname||'.'||seq_relname;
Then analyze database, opening access and restart slony...
The replication look to restarting in good state. lag time decrease and there is no error message in slony/postgresql logs...
Overload on my (busy) master database is realy lower than adding a new node (after drop old one...)
Is anybody try to do somethink like this ?
Regards,
- Previous message: [Slony1-general] UTF-8 encoding Error
- Next message: [Slony1-general] Slave upgrade without break replication
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list