Sat Feb 26 07:11:42 PST 2011
- Previous message: [Slony1-general] Replication problem
- Next message: [Slony1-general] Replication problem
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Stéphane.
Don't know how to set the archive logging mode. I followed the tutorial and
made myself a setup script as follows:
-------------------------------------------------------------------------------
#!/bin/sh
CLUSTERNAME=plasma_cluster
MASTERDBNAME=plasma
SLAVEDBNAME=plasma
MASTERHOST=192.168.100.1
SLAVEHOST=192.168.100.2
REPLICATIONUSER=plasma
DBUSER=plasma
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 password=XXXXXXXX';
node 2 admin conninfo = 'dbname=$SLAVEDBNAME host=$SLAVEHOST
user=$REPLICATIONUSER password=XXXXXXXX';
#--
# 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');
#--
# 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='Products handling');
set add table (set id=1, origin=1, id=1, fully qualified name
= 'public.product', comment='');
set add table (set id=1, origin=1, id=2, fully qualified name
= 'public.provider', comment='');
set add table (set id=1, origin=1, id=3, fully qualified name
= 'public.product_type', comment='');
set add table (set id=1, origin=1, id=4, fully qualified name
= 'public.content_type', comment='');
set add table (set id=1, origin=1, id=5, fully qualified name
= 'public.dimension', comment='');
set add table (set id=1, origin=1, id=6, fully qualified name
= 'public.dimension_type', comment='');
set add table (set id=1, origin=1, id=7, fully qualified name
= 'public.censure', comment='');
set add table (set id=1, origin=1, id=8, fully qualified name
= 'public.users', comment='');
set add table (set id=1, origin=1, id=9, fully qualified name
= 'public.category', comment='');
set add table (set id=1, origin=1, id=10,fully qualified name
= 'public.subcategory', comment='');
set add table (set id=1, origin=1, id=11,fully qualified name
= 'public.singer', comment='');
set add table (set id=1, origin=1, id=12,fully qualified name
= 'public.author', comment='');
set add table (set id=1, origin=1, id=13,fully qualified name
= 'public.publishing_house', comment='');
set add table (set id=1, origin=1, id=14,fully qualified name
= 'public.instance', comment='');
set add table (set id=1, origin=1, id=15,fully qualified name
= 'public.mime_types', comment='');
set add table (set id=1, origin=1, id=16,fully qualified name
= 'public.compatibility_groups', comment='');
set add table (set id=1, origin=1, id=17,fully qualified name
= 'public.model_devices', comment='');
set add table (set id=1, origin=1, id=18,fully qualified name
= 'public.array_name', comment='');
#--
# 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', event node=1);
store path (server = 1, client = 2, conninfo='dbname=$MASTERDBNAME
host=$MASTERHOST user=$REPLICATIONUSER password=XXXXXXXX');
store path (server = 2, client = 1, conninfo='dbname=$SLAVEDBNAME
host=$SLAVEHOST user=$REPLICATIONUSER password=XXXXXXXX');
_EOF_
-------------------------------------------------------------------------------------------
I started the slon processes with "service slony1-II start" at both ends and
then started replication at the master node with:
-------------------------------------------------------------------------------------------
#!/bin/sh
CLUSTERNAME=plasma_cluster
MASTERDBNAME=plasma
MASTERHOST=192.168.100.1
SLAVEDBNAME=plasma
SLAVEHOST=192.168.100.2
REPLICATIONUSER=plasma
slonik <<_EOF_
# ----
# This defines which namespace the replication system uses
# ----
cluster name = $CLUSTERNAME;
# ----
# Admin conninfo's are used by the slonik program to connect
# to the node databases. So these are the PQconnectdb arguments
# that connect from the administrators workstation (where
# slonik is executed).
# ----
node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MASTERHOST
user=$REPLICATIONUSER password=XXXXXXXX';
node 2 admin conninfo = 'dbname=$SLAVEDBNAME host=$SLAVEHOST
user=$REPLICATIONUSER password=XXXXXXXX';
# ----
# Node 2 subscribes set 1
# ----
subscribe set ( id = 2, provider = 1, receiver = 2, forward = no);
_EOF_
----------------------------------------------------------------------------------------------
Regards.
On Saturday 26 February 2011 07:58, Stéphane A. Schildknecht wrote:
> Le 26/02/2011 01:12, Hugo Pérez Casanova a écrit :
> > Hi Everybody.
> >
> > I'm not sure if this is the right list, correct me if I'm wrong.
>
> Yes it is. There is no better place than slony mailing-lists to talk about
> slony :-)
>
> > This is the first time I've worked with slony.
> >
> > I made a test environment with two virtual servers working in CentOS 5.5,
> > Postgresql 8.4 and Slony 2.0.6. Test environment works fine.
> >
> > When moving to production I have cloned a mid size database, when
> > replication starts I see at the slon log that it founds all tables to
> > replicate. The problem appears when writing to a tmp archive. Following
> > is a snippet of the log:
> >
> > 2011-02-25 18:07:32 CSTCONFIG remoteWorkerThread_1: prepare to copy
> > table "public"."model_devices"
> > 2011-02-25 18:07:32 CSTCONFIG remoteWorkerThread_1: prepare to copy
> > table "public"."array_name"
> > 2011-02-25 18:07:32 CSTCONFIG remoteWorkerThread_1: all tables for set 1
> > found on subscriber
> > 2011-02-25 18:07:32 CSTCONFIG remoteWorkerThread_1: copy
> > table "public"."provider"
> > 2011-02-25 18:07:33 CSTCONFIG remoteWorkerThread_1: Begin COPY of
> > table "public"."provider"
> > NOTICE: truncate of "public"."provider" failed - doing delete
> > 2011-02-25 18:07:33 CSTERROR remoteWorkerThread_1: Cannot write to
> > archive file /tmp/slony1_log_2_00000000000000000366.sql.tmp - not open
> > 2011-02-25 18:07:33 CSTWARN remoteWorkerThread_1: data copy for set 1
> > failed 19 times - sleep 60 seconds
> >
> > What am I doing wrong?
>
> Could you give us more information about the way you settled the
> replication ? Did you set the archive logging mode ?
> Seems like you can't write in /tmp either bacause you don't have the right
> to, or because there's no place left.
>
> Regards,
>
> --
> Stéphane Schildknecht
> http://www.loxodata.com
> _______________________________________________
> Slony1-general mailing list
> Slony1-general at lists.slony.info
> http://lists.slony.info/mailman/listinfo/slony1-general
--
IEE José Hugo Pérez Casanova
Gerente de Sistemas
Linux Soluciones Integrales
Antón de Alaminos #256-B, Fracc. Virginia,
Boca del Río Veracruz,
México, 94294
Tel/Fax (52) 229-937-7777
www.linux-si.com
--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que estᅵ limpio.
- Previous message: [Slony1-general] Replication problem
- Next message: [Slony1-general] Replication problem
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list