dbTalk Databases Forums  

getting slony1's slonik script to work

comp.databases.postgresql comp.databases.postgresql


Discuss getting slony1's slonik script to work in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steven Mocking
 
Posts: n/a

Default getting slony1's slonik script to work - 09-29-2006 , 10:40 AM






After getting slony to run succesfully on one server with simply two
local databases as master and slave, the other one appears to be more of
a challenge.

This is my slonik-invoking shell script:

---
#!/bin/sh

# Location of pgsql and Slony-I binaries
PGBIN=/usr/local/pgsql/bin
# Name of our cluster
CLUSTER=tksync
# Master DB
MASTERDBNAME=syncm
# Slave DB
SLAVEDBNAME=syncs
# Master password
MPASSWORD=xxxxxx
# Slave pass
SPASSWORD=xxxxxx
# Primary host
MASTERHOST="127.0.0.1"
SLAVEHOST="127.0.0.1"
# user
REPLICATIONUSER=slony

PATH=$PGBIN:$PATH


slonik <<_EOF_
# Define the namespace the replication system uses
cluster name = $CLUSTER;

#--
# admin conninfo's are used by slonik to connect to the nodes one for each
# node on each side of the cluster, the syntax is that of PQconnectdb in
# the C-API
# --
node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MASTERHOST
user=$REPLICATIONUSER password=$MPASSWORD';
node 2 admin conninfo = 'dbname=$SLAVEDBNAME host=$SLAVEHOST
user=$REPLICATIONUSER password=$SPASSWORD';

#--
# init the first node. Its id MUST be 1. This creates the schema
# _$CLUSTER containing all replication system specific database
# objects.

#--
init cluster ( id=1, comment = 'Master Node');

#--
# Because the history table does not have a primary key or other unique
# constraint that could be used to identify a row, we need to add one.
# The following command adds a bigint column named
# _Slony-I_$CLUSTER_rowID to the table. It will have a default value
# of nextval('_$CLUSTER.s1_rowid_seq'), and have UNIQUE and NOT NULL
# constraints applied. All existing rows will be initialized with a
# number
#--
# table add key (node id = 1, fully qualified name = 'public.poeppie');

#--
# 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 synctest tables');

set add table (set id=1, origin=1, id=1, fully qualified name =
'public.poeppie', comment='poeppie');
# 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);

# set add table (set id=1, origin=1, id=4, fully qualified name =
'public.history', comment='history table', key = serial);

#--
# Create the second node (the slave) tell the 2 nodes how to connect to
# each other and how they should listen for events.
#--

store node (id=2, comment = 'Slave node');
store path (server = 1, client = 2, conninfo='dbname=$MASTERDBNAME
host=$MASTERHOST user=$REPLICATIONUSER password=$MPASSWORD');
store path (server = 2, client = 1, conninfo='dbname=$SLAVEDBNAME
host=$SLAVEHOST user=$REPLICATIONUSER password=$SPASSWORD');
store listen (origin=1, provider = 1, receiver =2);
store listen (origin=2, provider = 2, receiver =1);
_EOF_

---

This is identical to the variant which worked perfectly on another
server. And I can login to both master and slave databases on the host
with the user/pass in the script.

But when I try to run it:

---
user@host ~/slony$ ./mkSlonyConfig.sh
<stdin>:18: loading of file /usr/local/pgsql/share//xxid.v73.sql:
PGRES_FATAL_ERROR ERROR: current transaction is aborted, queries
ignored until end of transaction block
ERROR: current transaction is aborted, queries ignored until end of
transaction block
<stdin>:18: ERROR: no admin conninfo for node 134584768
---

A crucial difference might be that the first server ran postgresql 8.1
and the second 7.3 (7.3.2 to be exact). Also, the second was compiled
from source.

What am I doing wrong?

Reply With Quote
  #2  
Old   
Steven Mocking
 
Posts: n/a

Default Re: getting slony1's slonik script to work - 09-29-2006 , 02:25 PM






Steven Mocking wrote:
Quote:
A crucial difference might be that the first server ran postgresql 8.1
and the second 7.3 (7.3.2 to be exact). Also, the second was compiled
from source.
Apparently 7.3.3 is the lowest supported version. (thanks go to Tim
Goodaire from the mailing list for pointing that out). Here's a patch
for the configure script:

http://gborg.postgresql.org/project/...pdate.php?1587


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.