On Wed, 19 Oct 2016, Andrew Edson wrote:
I am working on setting up a secondary machine, at another location, with
roughly the same structure as
our primary machine here. The current machine is running Slony 2.0 (I think
2.0.7 but cannot recall for
certain) against Postgres 8.4.13, the newer one is running Slony 2.1.4 against
Postgres 9.2.15.
The main machine uses slony to generate log-shipping files, which are then sent
out to other servers we
maintain to feed the local database copies on them. The new remote machine is
intended as a backup to
this system, eventually to become a replacement for the current machine. To
this end, I was asked to get
the new remote machine set up to both create log files, and to receive the log
files we’re sending to the
other machines we maintain.
I have managed to install Slony 2.1.4 on the new machine, and I have verified
that I can replicate
changes input manually on the new machine. Changes from the log files being
generated by the old
machine, however, don’t replicate on the new system. I believe, from what I’ve
found online, that the
cause of this is the line ‘set session_replication_role to replica;’ found near
the beginning of the log
files. If I’m understanding correctly, that is forcing the system to bypass
the triggers that Slony
needs to run the replication setup.
Is there some setting I can change in the Slony instance on the log-shipping
generating machine to
prevent the log files from being sent out with that line, or something I can
change on the receiving
machine that will allow it to ignore the line in question? Or something else,
perhaps, which can work to
resolve this? What options do I have for getting this setup to work?
Generally people don't generate logshipping files in a cascaded fashion.
Can't you just send the sames files to multiple locations.
Also your missing something in your setup. You need at least 3 nodes wiht
log shipping, the origin, a replica that slon is generating the log shipping
files(B, which is a proper replica with a slon) and node C the machine
receiving your logshipping files.
A-->slon->B->logshipping files--->C
You can just then also ship the files to nodes D and E
If you stripped the session replication role from the .sql files (which you
could do with a script I guess) you could then do something like
A-->slon->B->log shipping files->C--->slon--->D
where you are actually running 2 slony clusters one with nodes A,B and one
with nodes C,D (I guess this is what your trying to do?)
The set session_replication_role is added to the .sql files by slon in
remote_worker.c (see archive_open) and can't be disabled without changing
the code
Thank you,
Andrew Edson
Application Software, Inc.
_______________________________________________
Slony1-general mailing list
Slony1-general@lists.slony.info
http://lists.slony.info/mailman/listinfo/slony1-general