Unix Technical Forum

slony replication

This is a discussion on slony replication within the pgsql Novice forums, part of the PostgreSQL category; --> Hi All, I installed slony1.0.5 and tried the example replication of pgbench database. That seemed to work. Now I ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:16 PM
sarlav kumar
 
Posts: n/a
Default slony replication

Hi All,

I installed slony1.0.5 and tried the example replication of pgbench database. That seemed to work. Now I need to replicate a DB running on a different server. slony1.0.5 is installed on the Fedora core 3 machine where Postgres 7.4.6 is installed. I have to replicate the 'test' database installed on a different machine using Postgres 7.3.2.

In the instructions to replicate the pgbench example, there is script file to create the initial configuration for the master-slave setup of the pgbench database. Is this the script file that has to be modified accordingly, to replicate my 'test' DB. And ofcourse, the shell variables have to be changed to indicate the correct location of the master and slave DBs. Am I right?

Also, in the script, the following lines are used to create sets of tables:
# Slony-I organizes tables into sets. The smallest unit a node can
# subscribe is a set. The following commands create one set containing
# all 4 pgbench tables. The master or origin of the set is node 1.
#--
create set (id=1, origin=1, comment='All pgbench tables');
set add table (set id=1, origin=1, id=1, fully qualified name = 'public.accounts', comment='accounts table');
set add table (set id=1, origin=1, id=2, fully qualified name = 'public.branches', comment='branches table');
set add table (set id=1, origin=1, id=3, fully qualified name = 'public.tellers', comment='tellers table');
set add table (set id=1, origin=1, id=4, fully qualified name = 'public.history', comment='history table', key = serial);

#--

Can this be skipped? I have over 200 tables, and I am not sure if I have to list each of them in the "set add table" part of the scripts file.

Do I need to change any of the other scripts file in the example?

Thanks in advance,
Saranya








---------------------------------
Do you Yahoo!?
Send a seasonal email greeting and help others. Do good.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 09:16 PM
Christopher Browne
 
Posts: n/a
Default Re: slony replication

sarlavk@yahoo.com (sarlav kumar) writes:
> I installed slony1.0.5 and tried the example replication of pgbench
> database. That seemed to work. Now I*need to*replicate a DB running
> on a different server. slony1.0.5 is installed on the Fedora core 3
> machine where Postgres 7.4.6 is installed. I have to replicate the
> 'test' database installed on a different machine using Postgres
> 7.3.2.


Slony-I does not support versions of PostgreSQL earlier than 7.3.3.
As 7.3.2 is earlier than 7.3.3, I wouldn't expect that to work.

> In the instructions to replicate the pgbench example, there is
> script file to create the initial configuration for the master-slave
> setup of*the pgbench database. Is this the script file that has to
> be modified accordingly, to replicate my 'test' DB. And ofcourse,
> the shell variables have to be changed to indicate the correct
> location of the master and slave DBs. Am I right?


Yes, that would be right.

> Also, in the script, the following lines are used to create sets of tables:
>
> # Slony-I organizes tables into sets.* The smallest unit a node can
> *** # subscribe is a set.* The following commands create one set containing
> *** # all 4 pgbench tables.* The master or origin of the set is node 1.
> #--
> create set (id=1, origin=1, comment='All pgbench tables');
> set add table (set id=1, origin=1, id=1, fully qualified name = 'public.accounts', comment='accounts table');
> set add table (set id=1, origin=1, id=2, fully qualified name = 'public.branches', comment='branches table');
> set add table (set id=1, origin=1, id=3, fully qualified name = 'public.tellers', comment='tellers table');
> set add table (set id=1, origin=1, id=4, fully qualified name = 'public.history', comment='history table', key =
> serial);
> #--
>
> Can this be skipped? I have over 200 tables, and I am not sure if I
> have to list each of them in the "set add table" part of the scripts
> file.


No, you cannot "skip" this. You _must_ submit slonik requests to add
each and every table that you wish to replicate to the replication
set.

If there are 220 tables, you'll need something rather close to 220
"set add table" requests.

> Do I need to change any of the other scripts file in the example?


Maybe, depending on what you're trying to do.
--
"cbbrowne","@","ca.afilias.info"
<http://linuxdatabases.info/info/slony.html>
Christopher Browne
(416) 673-4124 (land)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 09:18 PM
Robert Treat
 
Posts: n/a
Default Re: [PERFORM] slony replication

I didn't see any responses to this, but given it is off topic for both groups
that wouldn't surprise me. In the future please direct these questions to the
slony project mailing lists.

On Monday 20 December 2004 17:25, sarlav kumar wrote:
> Hi All,
>
> I installed slony1.0.5 and tried the example replication of pgbench
> database. That seemed to work. Now I need to replicate a DB running on a
> different server. slony1.0.5 is installed on the Fedora core 3 machine
> where Postgres 7.4.6 is installed. I have to replicate the 'test' database
> installed on a different machine using Postgres 7.3.2.
>
> In the instructions to replicate the pgbench example, there is script file
> to create the initial configuration for the master-slave setup of the
> pgbench database. Is this the script file that has to be modified
> accordingly, to replicate my 'test' DB. And ofcourse, the shell variables
> have to be changed to indicate the correct location of the master and slave
> DBs. Am I right?
>


More or less. The scripts provided are just examples, but you can modify them
to suite your einvironment rather than write your own.

> Also, in the script, the following lines are used to create sets of tables:
> # Slony-I organizes tables into sets. The smallest unit a node can
> # subscribe is a set. The following commands create one set containing
> # all 4 pgbench tables. The master or origin of the set is node 1.
> #--
> create set (id=1, origin=1, comment='All pgbench tables');
> set add table (set id=1, origin=1, id=1, fully qualified name =
> 'public.accounts', comment='accounts table'); set add table (set id=1,
> origin=1, id=2, fully qualified name = 'public.branches', comment='branches
> table'); set add table (set id=1, origin=1, id=3, fully qualified name =
> 'public.tellers', comment='tellers table'); set add table (set id=1,
> origin=1, id=4, fully qualified name = 'public.history', comment='history
> table', key = serial);
>
> #--
>
> Can this be skipped? I have over 200 tables, and I am not sure if I have to
> list each of them in the "set add table" part of the scripts file.
>


nope, you have to do them all, and dont forget the sequences. easiest way i
found was to generate the list programatically around a select * from
pg_class with appropriate where clause to get just the desired tables.

> Do I need to change any of the other scripts file in the example?
>


Chances are yes, since those scripts were written for the example scenario
provided, and your environment is sure to be different. Again, post to the
slony mailing lists if you need more help.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:18 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com