Melvin Davidson melvin6925 at yahoo.com
Mon Jun 8 15:45:55 PDT 2009
Are you trying to use the exact same script to
toggle?You cannot do that. You need one script to toggle from node 1
(master) to node 101 (slave), and a second script (the exact opposite,
to toggle from node 101 (now master) to node 1 (now slave).



See the example of the slonik move set command:

http://slony.info/documentation/stmtmoveset.html



Melvin Davidson =

 Home 720-870-9595 =

 =A0=A0=A0 Cell 720-320-0155  =


I reserve the right to fantasize.=A0 Whether or not you =

 wish to share my fantasy is entirely up to you. =


www.youtube.com/unusedhero
 =

 Folk Alley - All Folk - 24 Hours a day =

www.folkalley.com



--- On Mon, 6/8/09, owais at preceptglobalaccess.com <owais at preceptglobalacces=
s.com> wrote:

From: owais at preceptglobalaccess.com <owais at preceptglobalaccess.com>
Subject: Re:  [Slony1-general] How to shut-down slony replication
To: "Melvin Davidson" <melvin6925 at yahoo.com>, slony1-general at lists.slony.in=
fo, "owais" <owais at preceptglobalaccess.com>
Date: Monday, June 8, 2009, 10:05 AM

I don't get it. Can you explain a bit more. =


As i have 1 master and 1 slave. Then i run a toggle script that changes my =
slave to master and my master to slave. =


Therefore, My previous slave is a new master. =


Now, I want to toggle again. And it is giving me an error. What is wrong in=
 it ? =


- Owais
=A0
-----Original Message-----
From: Melvin Davidson [mailto:melvin6925 at yahoo.com]
Sent: Monday, June 8, 2009 08:08 AM
To: slony1-general at lists.slony.info, 'owais'
Subject: RE: [Slony1-general] How to shut-down slony replication

owais, =


>when I toggle
from slave to master, it gives me error.

>"_OAK_CLUSTER".getMaxXid();=A0 - ERROR:=A0 Slony-I: set 1 does
not originate on local node

 =


The purpose of the switchover is to change the master to the slave and slav=
e to master. But you cannot switch from a slave to a master. There is no po=
int in that.

Melvin Davidson =

 =



--- On Mon, 6/8/09, owais <owais at preceptglobalaccess.com> wrote:

From: owais <owais at preceptglobalaccess.com>
Subject: RE: [Slony1-general] How to shut-down slony replication
To: "'Melvin Davidson'"
 <melvin6925 at yahoo.com>, slony1-general at lists.slony.info
Date: Monday, June 8, 2009, 1:39 AM












Toggling from master to slave is working fine. But when I toggle
from slave to master, it gives me error.

 =A0

<stdin>:19: PGRES_FATAL_ERROR select
"_OAK_CLUSTER".lockSet(1); select
"_OAK_CLUSTER".getMaxXid();=A0 - ERROR:=A0 Slony-I: set 1 does
not originate on local node

 =A0

Kindly help me

 =A0

-Owais

 =A0



From: Melvin Davidson
[mailto:melvin6925 at yahoo.com] =


Sent: Tuesday, June 02, 2009 7:18 PM

To: slony1-general at lists.slony.info; owais

Subject: Re: [Slony1-general] How to shut-down slony replication



 =A0


 =

  =

  To temporarily stop
  replication, I issue=A0=A0 pkill slon=A0 on the master and
  all slave. =


  =


  To toggle a master and slave, I use a slonik script like one below:

  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

  slonik <<_EOF_

  =


  #--

  # define the namespace the replication system uses in our example it is

  # slony_example

  #--

  CLUSTER NAME =3D $PTS_META_REP;

  =


  #--

  # 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=3D'dbname=3D$MASTERDBNAME host=3D$MASTERHOST port=
=3D$PGPORT
  user=3D$REPLICATIONUSER';

  node 101 admin conninfo=3D'dbname=3D$MASTERDBNAME host=3D$SLAVEHOST1 port=
=3D$JCIPORT
  user=3D$REPLICATIONUSER';

  =


  # ----

  # Switchover to node 101, make node 1 the slave

  # ----

  =


  lock set (id =3D 1, origin =3D 1);

  wait for event (origin =3D 1, confirmed =3D 101);

  move set (id =3D 1, old origin =3D 1, new origin =3D 101);

  wait for event (origin =3D 1, confirmed =3D 101);

  =


  _EOF_

  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

  =


  Likewise to switch back, I use:

  =


  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

  slonik <<_EOF_

  =


  #--

  # define the namespace the replication system uses in our example it is

  # slony_example

  #--

  CLUSTER NAME =3D $PTS_META_REP;

  =


  #--

  # 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=3D'dbname=3D$MASTERDBNAME host=3D$MASTERHOST port=
=3D$PGPORT
  user=3D$REPLICATIONUSER';

  node 101 admin conninfo=3D'dbname=3D$MASTERDBNAME host=3D$SLAVEHOST1 port=
=3D$JCIPORT
  user=3D$REPLICATIONUSER';

  =


  # ----

  # Switchover to node 1, make node 101 the slave

  # ----

  =


  lock set (id =3D 1, origin =3D 101);

  wait for event (origin =3D 101, confirmed =3D 1);

  move set (id =3D 1, old origin =3D 101, new origin =3D 1);

  wait for event (origin =3D 101, confirmed =3D 1);

  =


  _EOF_

  =


  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
  =

  Melvin Davidson =

  =

  =


  =


  --- On Tue, 6/2/09, owais <owais at preceptglobalaccess.com>
  wrote:
  =


  From: owais <owais at preceptglobalaccess.com>

  Subject: [Slony1-general] How to shut-down slony replication

  To: slony1-general at lists.slony.info

  Date: Tuesday, June 2, 2009, 7:17 AM
  =

  =

  Hi
  guys, I just start looking in to slony1 project. The project has impresse=
d me
  a lot. I have successfully manage to start the replication between two
  databases (one the same machine). I have used the following article to se=
tup
  slony replication (http://www.linuxjournal.com/article/7834).
  =

  =A0
  Now,
  I have the following questions:
  =A0
  1)=A0=A0=A0=A0=A0
  What is the procedure to stop replication process? Can anyone present
  me a sample shell script?
  =A0
  2)=A0=A0=A0=A0=A0
  Is it possible to toggle master and slave? I only have 1 master
  database and 1 slave. Can I change slave to master?
  =A0
  -Regards
  =A0
  Owais
  =

  =

  =


  -----Inline Attachment Follows-----
  =

  _______________________________________________

  Slony1-general mailing list

  Slony1-general at lists.slony.info

  http://lists.slony.info/mailman/listinfo/slony1-general
  =

  =

 =



 =A0










      =



      =

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.slony.info/pipermail/slony1-general/attachments/20090608/=
8b4375ad/attachment.htm


More information about the Slony1-general mailing list