Hi All:
In an effort to install a PostgreSQL Replication cluster, I setup 3
nodes with RHES 4 update 4 and installed the rpms for both PostgreSQL
and Slony-I (which was built from a source rpm).
I followed the instructions in the Slony-I docs and am now currently
stuck trying to Configure the Database for Replication. using the slonik
commands directly (placed all the commands in a bash script).
The error that I get when I run the script:
<error>
-bash-3.00$ ./initialConfigurationMaster2Slave.bash
<stdin>:22: PGRES_FATAL_ERROR load '$libdir/xxid'; - ERROR: access to
library "$libdir/xxid" is not allowed
<stdin>:22: Error: the extension for the xxid data type cannot be loaded
in database 'dbname=pgbench host=pgmaster user=pgsql'
<stdin>:22: ERROR: no admin conninfo for node 144068992
</error>
I have read lots of post regarding the same error but none of the
solutions apply to my problem (slony-I is installed on all hosts). Any
help would be greatly appreciated.
Scripts:
<env variables>
#!/bin/bash
# setup PostgreSQL environment variables
CLUSTERNAME=slony_example
export CLUSTERNAME
MASTERDBNAME=pgbench
export MASTERDBNAME
SLAVEDBNAME1=pgbenchslave1
export SLAVEDBNAME1
SLAVEDBNAME2=pgbenchslave2
export SLAVEDBNAME2
MASTERHOST=pgmaster
export MASTERHOST
SLAVEHOST1=pgslave1
export SLAVEHOST1
SLAVEHOST2=pgslave2
export SLAVEHOST2
REPLICATIONUSER=pgsql
export REPLICATIONUSER
PGBENCHUSER=pgbench
export PGBENCHUSER
</env variables>
<snippet>
#!/bin/bash
# The traditional approach to administering slony is to craft slonik
commands directly.
# The script to create the initial configuration for the simple
master-slave-slave setup of
# our pgbench database looks like this:
slonik <<_EOF_
#--
# define the namespace the replication system uses in our example it is
# slony_example
#--
cluster name = $CLUSTERNAME;
#--
# 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';
node 2 admin conninfo = 'dbname=$SLAVEDBNAME1 host=$SLAVEHOST1
user=$REPLICATIONUSER';
node 3 admin conninfo = 'dbname=$SLAVEDBNAME2 host=$SLAVEHOST2
user=$REPLICATIONUSER';
#--
# init the first node. Its id MUST be 1. This creates the schema
# _$CLUSTERNAME 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_$CLUSTERNAME_rowID to the table. It will have a default
value
# of nextval('_$CLUSTERNAME.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.history');
#--
# 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);
#--
# Create the second node (the slave) tell the 3 nodes how to connect to
# each other and how they should listen for events.
#--
store node (id=2, comment = 'Primary Slave node');
store node (id=3, comment = 'Secondary Slave node');
#echo 'Initializing slaves, pgslave1 and pgslave2.';
store path (server = 1, client = 2, conninfo='dbname=$MASTERDBNAME
host=$MASTERHOST user=$REPLICATIONUSER');
store path (server = 1, client = 3, conninfo='dbname=$MASTERDBNAME
host=$MASTERHOST user=$REPLICATIONUSER');
store path (server = 2, client = 1, conninfo='dbname=$SLAVEDBNAME1
host=$SLAVEHOST1 user=$REPLICATIONUSER');
store path (server = 3, client = 1, conninfo='dbname=$SLAVEDBNAME2
host=$SLAVEHOST2 user=$REPLICATIONUSER');
store listen (origin=1, provider=1, receiver=2);
store listen (origin=2, provider=2, receiver=1);
store listen (origin=1, provider=1, receiver=3);
store listen (origin=3, provider=3, receiver=1);
_EOF_
</snippet>
Kind Rgds,
Ouray Viney
Systems Analyst