<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.emailstyle17
        {mso-style-name:emailstyle17;}
span.emailstyle171
        {mso-style-name:emailstyle171;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link="#000000" vlink="#000000">

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Toggling from master to slave is working fine. But when I toggle
from slave to master, it gives me error.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText>&lt;stdin&gt;:19: PGRES_FATAL_ERROR select
&quot;_OAK_CLUSTER&quot;.lockSet(1); select
&quot;_OAK_CLUSTER&quot;.getMaxXid();&nbsp; - ERROR:&nbsp; Slony-I: set 1 does
not originate on local node<o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Kindly help me<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>-Owais<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Melvin Davidson
[mailto:melvin6925@yahoo.com] <br>
<b>Sent:</b> Tuesday, June 02, 2009 7:18 PM<br>
<b>To:</b> slony1-general@lists.slony.info; owais<br>
<b>Subject:</b> Re: [Slony1-general] How to shut-down slony replication<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0>
 <tr>
  <td valign=top style='padding:0in 0in 0in 0in'>
  <p class=MsoNormal style='margin-bottom:12.0pt'>To temporarily stop
  replication, I issue&nbsp;&nbsp; <u>pkill slon</u>&nbsp; on the master and
  all slave. <br>
  <br>
  To toggle a master and slave, I use a slonik script like one below:<br>
  ===========================================================<br>
  slonik &lt;&lt;_EOF_<br>
  <br>
  #--<br>
  # define the namespace the replication system uses in our example it is<br>
  # slony_example<br>
  #--<br>
  CLUSTER NAME = $PTS_META_REP;<br>
  <br>
  #--<br>
  # admin conninfo's are used by slonik to connect to the nodes one for each<br>
  # node on each side of the cluster, the syntax is that of PQconnectdb in<br>
  # the C-API<br>
  # --<br>
  node 1 admin conninfo='dbname=$MASTERDBNAME host=$MASTERHOST port=$PGPORT
  user=$REPLICATIONUSER';<br>
  node 101 admin conninfo='dbname=$MASTERDBNAME host=$SLAVEHOST1 port=$JCIPORT
  user=$REPLICATIONUSER';<br>
  <br>
  # ----<br>
  # Switchover to node 101, make node 1 the slave<br>
  # ----<br>
  <br>
  lock set (id = 1, origin = 1);<br>
  wait for event (origin = 1, confirmed = 101);<br>
  move set (id = 1, old origin = 1, new origin = 101);<br>
  wait for event (origin = 1, confirmed = 101);<br>
  <br>
  _EOF_<br>
  ===========================================================<br>
  <br>
  Likewise to switch back, I use:<br>
  <br>
  ===========================================================<br>
  slonik &lt;&lt;_EOF_<br>
  <br>
  #--<br>
  # define the namespace the replication system uses in our example it is<br>
  # slony_example<br>
  #--<br>
  CLUSTER NAME = $PTS_META_REP;<br>
  <br>
  #--<br>
  # admin conninfo's are used by slonik to connect to the nodes one for each<br>
  # node on each side of the cluster, the syntax is that of PQconnectdb in<br>
  # the C-API<br>
  # --<br>
  node 1 admin conninfo='dbname=$MASTERDBNAME host=$MASTERHOST port=$PGPORT
  user=$REPLICATIONUSER';<br>
  node 101 admin conninfo='dbname=$MASTERDBNAME host=$SLAVEHOST1 port=$JCIPORT
  user=$REPLICATIONUSER';<br>
  <br>
  # ----<br>
  # Switchover to node 1, make node 101 the slave<br>
  # ----<br>
  <br>
  lock set (id = 1, origin = 101);<br>
  wait for event (origin = 101, confirmed = 1);<br>
  move set (id = 1, old origin = 101, new origin = 1);<br>
  wait for event (origin = 101, confirmed = 1);<br>
  <br>
  _EOF_<br>
  <br>
  ===========================================================<o:p></o:p></p>
  <div id=RTEContent>
  <p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:
  13.5pt;font-family:"Arial","sans-serif";color:blue'>Melvin Davidson </span></b><o:p></o:p></p>
  </div>
  <p class=MsoNormal><br>
  <br>
  --- On <b>Tue, 6/2/09, owais <i>&lt;owais@preceptglobalaccess.com&gt;</i></b>
  wrote:<o:p></o:p></p>
  <p class=MsoNormal style='margin-bottom:12.0pt'><br>
  From: owais &lt;owais@preceptglobalaccess.com&gt;<br>
  Subject: [Slony1-general] How to shut-down slony replication<br>
  To: slony1-general@lists.slony.info<br>
  Date: Tuesday, June 2, 2009, 7:17 AM<o:p></o:p></p>
  <div id=yiv1087103116>
  <div>
  <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi
  guys, I just start looking in to slony1 project. The project has impressed 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 setup
  slony replication (<a href="http://www.linuxjournal.com/article/7834"
  target="_blank"><u><span style='color:blue'>http://www.linuxjournal.com/article/7834</span></u></a>).
  <o:p></o:p></p>
  <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p>
  <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Now,
  I have the following questions:<o:p></o:p></p>
  <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p>
  <p class=MsoListParagraph>1)<span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>What is the procedure to stop replication process? Can anyone present
  me a sample shell script?<o:p></o:p></p>
  <p class=MsoListParagraph>&nbsp;<o:p></o:p></p>
  <p class=MsoListParagraph>2)<span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>Is it possible to toggle master and slave? I only have 1 master
  database and 1 slave. Can I change slave to master?<o:p></o:p></p>
  <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p>
  <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>-Regards<o:p></o:p></p>
  <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p>
  <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Owais<o:p></o:p></p>
  </div>
  </div>
  <p class=MsoNormal style='margin-bottom:12.0pt'><br>
  -----Inline Attachment Follows-----<o:p></o:p></p>
  <div>
  <p class=MsoNormal>_______________________________________________<br>
  Slony1-general mailing list<br>
  <a href="/mc/compose?to=Slony1-general@lists.slony.info"><u><span
  style='color:blue'>Slony1-general@lists.slony.info</span></u></a><br>
  <a href="http://lists.slony.info/mailman/listinfo/slony1-general"
  target="_blank"><u><span style='color:blue'>http://lists.slony.info/mailman/listinfo/slony1-general</span></u></a><o:p></o:p></p>
  </div>
  </td>
 </tr>
</table>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'><o:p>&nbsp;</o:p></span></p>

</div>

</body>

</html>