Brian Fehrle brianf at consistentstate.com
Thu Jun 17 08:31:43 PDT 2010
I don't think it's quite a show-stopper, but when you add the paths, you 
should have an entry from every node to every other node, even from the 
slaves to each other.

store path (server=1, client=2, conninfo='service=sr_routing_02-slonik');
store path (server=1, client=3, conninfo='service=sr_routing_03-slonik');
store path (server=2, client=1, conninfo='service=sr_routing_01-slonik');
store path (server=3, client=1, conninfo='service=sr_routing_01-slonik');
store path (server=2, client=3, conninfo='service=sr_routing_01-slonik');
store path (server=3, client=2, conninfo='service=sr_routing_01-slonik');

And actually, now that I look at that, it looks like you may be giving the store paths the wrong conninfo. The conn info entered should be the connection information for the server specified. Such as:

store path (server=1, client=2, conninfo='service=sr_routing_01-slonik');
store path (server=1, client=3, conninfo='service=sr_routing_01-slonik');
store path (server=2, client=1, conninfo='service=sr_routing_02-slonik');
store path (server=3, client=1, conninfo='service=sr_routing_03-slonik');
store path (server=2, client=3, conninfo='service=sr_routing_02-slonik');
store path (server=3, client=2, conninfo='service=sr_routing_03-slonik');


Also, if you have the ability to look at the service/daemon's output 
logs for each of the slave nodes, it should report anything that's going 
wrong, such as the inability to connect to a node, or unable to write 
data to the replicated table on the slave database. Perhaps something in 
there can point to what may be going wrong.

The documentation has a page that helps with looking at the logs, it's 
for 1.2.21, but should all/mostly be valid:
http://lists.slony.info/adminguide/1.2/doc/adminguide/loganalysis.html

- Brian Fehrle

Shaun McCloud wrote:
> Brian,
>
> The tutorial I found for Slony on Windows has you use a bunch of different
> files to create the cluster.  You are correct, I have three database servers
> each with two databases.  Both master databases are on the same server & am
> I trying to use two replication groups to replicate the data.  I'm not sure
> what I did Monday/Tuesday morning but I am now to the point where I can't
> even replicate a single table.  Seems like I take 1 step forward on this and
> then take 10 steps backwords.
>
> The following is included in every file I pass to slonik when building the
> cluster.
>
> cluster name = sr_routing_cluster;
> node 1 admin conninfo = 'service=sr_routing_01-slonik';
> node 2 admin conninfo = 'service=sr_routing_02-slonik';
> node 3 admin conninfo = 'service=sr_routing_03-slonik';
>
> To initialize the cluster, I use a file containing
> include <preamble.sk>;
> init cluster (id=1,comment='hostname=172.16.6.70');
>
> Adding the nodes
> include <preamble.sk>;
> store node (id=2, comment='hostname=172.16.6.71', event node=1);
> store node (id=3, comment='hostname=172.16.6.72', event node=1);
>
> Adding the paths
> include <preamble.sk>;
> store path (server=1, client=2, conninfo='service=sr_routing_02-slonik');
> store path (server=1, client=3, conninfo='service=sr_routing_03-slonik');
> store path (server=2, client=1, conninfo='service=sr_routing_01-slonik');
> store path (server=3, client=1, conninfo='service=sr_routing_01-slonik');
>
> Config file for the slony service
> cluster_name='sr_routing_cluster'
> conn_info='service=sr_routing_01-slonik'
>
> Build the set
> include <preamble.sk>;
> create set (id=1, origin=1, comment='Spatial Router GIS Data');
>
> Add the table(s)
> include <preamble.sk>;
> set add table(set id=1, origin=1, id=1, fully qualified name='sde.routing',
> comment='Routing', key='routing_pk');
>
> And finally subscribe the slaves
> include <preamble.sk>;
> subscribe set (id=1, provider=1, receiver=2, forward=yes);
> sync(id=1);
> wait for event (origin=1, confirmed=2, wait on=1, timeout=30000);
> subscribe set (id=1, provider=1, receiver=3, forward=yes);
> sync(id=1);
> wait for event (origin=1, confirmed=3, wait on=1, timeout=30000);
>
> -----Original Message-----
> From: Brian Fehrle [mailto:brianf at consistentstate.com] 
> Sent: Wednesday, June 16, 2010 18:41
> Cc: Shaun McCloud; slony1-general at lists.slony.info
> Subject: Re: [Slony1-general] Replicate multiple databases in Windows
>
> Shaun,
>
>  From looking at your config file, I am assuming you have this type of 
> setup. Three physical postgres clusters, 6 total databases (two sets of 
> 3, where one database of each set is a master, the other two are slaves).
>
> --------------pg Cluster A--------------  <-- slony master 172.16.6.70
> ----database X---- ----database Y----
> ------table D------- ------- table H------
>
> --------------pg Cluster B--------------  <-- slony master 172.16.6.71
> ----database X---- ----database Y----
> ------table D------- ------- table H------
>
> --------------pg Cluster C--------------  <-- slony master 172.16.6.72
> ----database X---- ----database Y----
> ------table D------- ------- table H------
>
> ----Replication set 1----
> ----------table D ---------
>
> ----Replication set 2----
> ----------table H ---------
>
> I didn't see anywhere in the config file where you are defining a slony 
> cluster, I don't have any familiarity with slony on windows, so not sure 
> how this is handled. Are you trying to get all six nodes running in the 
> same slony cluster? If so, you'll need to have two separate "master" or 
> "origin" nodes on Cluster A. then for each of the x.71 and x.72 
> clusters, you will need two slony nodes set up as subscribers for their 
> respective replication sets.
>
> ---- Origin nodes ----
> Database 'X' on Cluster A will be the origin node for 'replication set 1'
> Database 'Y' on Cluster A will be the origin node for 'replication set 2'
>
> ---- Subscriber Nodes ----
> Database 'X' on Cluster B will be subscribed to 'replication set 1'
> Database 'Y' on Cluster B will be subscribed to 'replication set 2'
>
> Database 'X' on Cluster C will be subscribed to 'replication set 1'
> Database 'Y' on Cluster C will be subscribed to 'replication set 2'
>
> Another (and probably easier) option is to have two separate slony 
> clusters set up. With this, each slony cluster will only need to be 
> connected to three nodes (you will still need 6 nodes and a 
> service/daemon for each of them)
>
> --- slony cluster sr_routing ---
> pg Cluster A - Database X - replication set 1 <-- Origin node
> pg Cluster B - Database X - replication set 1 <-- Subscriber node
> pg Cluster C - Database X - replication set 1 <-- Subscriber node
>
> --- slony cluster sr_alt_routing ---
> pg Cluster A - Database Y - replication set 1 <-- Origin node
> pg Cluster B - Database Y - replication set 1 <-- Subscriber node
> pg Cluster C - Database Y - replication set 1 <-- Subscriber node
>
> So I'm not quite sure which of these you're attempting to get set up, 
> but if the error is something along the lines of asking "if I am using 
> the correct database when trying to subscribe the slaves to the first 
> replication set", I'd say to make sure that you are only subscribing the 
> correct slaves to the first replication set. Since you will have two 
> separate replication sets, one for each table that live on separate 
> databases, you won't want to subscribe Database 'Y' on pg Cluster C to 
> the replication set that Database 'X' on pg Cluster A is the origin node 
> for.
>
>
> I hope I got my assumptions right, as well as my conclusions. Any more 
> information you can provide us will help out.
>
> - Brian Fehrle
>
> Steve Singer wrote:
>   
>> Shaun McCloud wrote:
>>   
>>     
>>> Hello,
>>>
>>>  
>>>
>>> I am trying to replicate two databases in Windows (Web Server 2008R2 to 
>>> be exact) using Slony-I 1.2.15 & PostgreSQL 8.3 (my hands are tied on 
>>> the PostgreSQL version for right now).  The guide I found to go by is 
>>> from the kind folks at EnterpriseDB and works great for one database.  
>>> If I setup separate services for each database in my pg_service.conf 
>>> file I get event viewer errors asking if I am using the correct database 
>>> when trying to subscribe the slaves to the first replication set.  I 
>>> know it would be easier to put the two tables (yes, that's all I am 
>>> replicating total) into the same database, but if I do that then we have 
>>> to modify our customers data and we would like to avoid that if at all 
>>> possible.  Am I just trying to do something that isn't possible?
>>>     
>>>       
>> I should say that Slony under Win32 doesn't seem to get a lot of use, so 
>>    I can't rule out their being unreported problems under win32.
>>
>> In theory you should be able to have both databases on the same server. 
>>   What service names are your slons using?  sr_routing_01-slonik and 
>> sr_routing_02-slonik are both pointing at the same database, is this 
>> what you intended?  I see lots of entries in that conf file but you only 
>> have 2 databases (that you have told us about) so I would only expect 
>> you to need to slon services.
>>
>>
>>   
>>     
>
>
>   
>>   
>>     
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Slony1-general mailing list
>>> Slony1-general at lists.slony.info
>>> http://lists.slony.info/mailman/listinfo/slony1-general
>>>     
>>>       
>>   
>>     
>
>
>   



More information about the Slony1-general mailing list