Slony Error, Replication Postgres - Slonik : PGRES_FATAL_ERROR load '$libdir/slony1_funcs.2.2.0

1.6k Views Asked by At

So Far I have Done Slony Replication For Postrong in a single computer Successfully (Both Master and Slave Resides in Same Computer i.e. localhost).

I have done in Ubuntu 12.04, Suse Enterprise server 11, and Windows. I followed example steps from this Links. http://www.linuxjournal.com/article/7834?page=0,0 and this

I was even able to perform this steps between two different windows computer master ip : 192.168.0.3 Slave ip 192.168.0.8)

But when I tried Slony Replication between Windows and Suse (Master: Windows(192.168.0.3) and Slave:Suse(192.168.0.9)) when i run slonik C:\Slony\mtscript.txt , I got this Error

C:\Slony\mtscript.txt:8: PGRES_FATAL_ERROR load '$libdir/slony1_funcs.2.2.0'; - ERROR: could not access file "$libdir/slony1_funcs.2.2.0": No such file or directory

C:\Slony\mtscript.txt:8: Error: the extension for the Slony-I C functions cannot be loaded in database 'dbname=repdb_slave host=192.168.0.9 port=5432 user=postgres password=root'

When i googled for this error i dint found much, I just came to know that by ruining command ./pg_config i found that,

(1)in windows slony1_funcs.2.2.0.dll is in LIBDIR = C:/PROGRA~2/POSTGR~1/9.3/lib (i.e C:\Program Files (x86)\PostgreSQL\9.3\lib)

(2)and in Suse slony1_funcs.2.2.0.so is in PKGLIBDIR = /opt/PostgreSQL/9.3/lib/postgresql

EDIT :

My Script File : mtscript.txt

cluster name = repdb_cluster_suse;
node 1 admin conninfo = 'dbname=repdb host=192.168.0.3 port=5432 user=postgres password=root';
node 2 admin conninfo = 'dbname=repdb_slave host=192.168.0.9 port=5432 user=postgres password=root';
init cluster (id = 1, comment = 'Node 1');
create set (id = 1, origin = 1,comment = 'contact table');
set add table (set id = 1, origin = 1, id = 1,full qualified name = 'public.contact',comment = 'Table contact');
set add sequence (set id = 1, origin = 1, id = 2,full qualified name = 'public.contact_seq',comment = 'Sequence contact_seq');
store node (id = 2, comment = 'Node 2',event node=1);
store path (server = 1, client = 2,conninfo = 'dbname=repdb host=192.168.0.3 port=5432 user=postgres password=root');
store path (server = 2, client = 1,  conninfo = 'dbname=repdb_slave host=192.168.0.9 port=5432 user=postgres password=root');
store listen (origin = 1, provider = 1, receiver = 2);
store listen (origin = 2, provider = 2, receiver = 1);

I have installed same version of Postgres(Version 9.3.5.1) and slony(2.2.0-1).(both downloaded for from here 32 bit version)

Windows Postgres Installation Directory is C:\Program Files (x86)\PostgreSQL\9.3

suse Postgres install Directory is /opt/PostgreSQL/9.3/bin

So How to Solve this Error? How to perform Slony replication between windows and linux(suse)?

any help wold be appreciated.

Thanks in advance

2

There are 2 best solutions below

0
Jony On BEST ANSWER

Thanks to Richard Huxton , that i found out my problem, according to him load 'slony1_funcs.2.2.0'; give me an error both in windows and linux and then i realize that my Slony version are different, in Windows, Version was 2.2.0 and in linux it was 2.2.2, (got different Slony version in Stackbuilder of Postgres 9.3 for windows and linux )

So I Un-install Slony 2.2.2 from linux and manually builded and installed Slony 2.2.0 For Suse Linux.

And now Windows <==> Linux Slony Replication Works fine.

1
Richard Huxton On

OK - there's nothing obviously wrong with your setup script, and we know it works for Windows<=>Windows and Linux<=>Linux.

From your windows machine, can you try something like:

C:> psql -h 192.168.0.9 -U postgres -d repdb_slave
postgres# load 'foo';
postgres# load 'slony1_funcs.2.2.0';

The first one should give an error, and the second one should work. If not, check the pg_config settings and file location and permissions again.

Also - check the PostgreSQL server logs. If you don't see the first error logged there, make sure you are logging errors with database and user-name and try again. Then you can try slony again and just check it's doing what we think it is.

If the second "load" does work, then it might be a bug in slony itself (something to do with line-endings or similar). They have mailing-lists mentioned on http://slony.info and I would take this problem there, giving a link to this question.

There must be plenty of people who have done cross-platform replication, so it strikes me as odd that there'd be such an obvious bug in Slony. I can't see what we're missing though.