<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Dear all</div><div><br></div><div>I'm new to pgpool2 and apparently missing something fundamental. My setup is master/slave streaming replication (postgresql 9.3 native) and pgpool2 3.3.2 (from ubuntu prepackaged) on both machines. I have my backend0 and backend1 pointing to devdb1.lan and slave.devdb1.lan, both set to allow failover and i have load balancing enabled and watchdog with VIP enabled in pgpool.</div><div><br></div><div>All I want is this: </div><div>1) have a VIP (virtual ip) on the current master, to which i'm going to send requests</div><div>2) automatic failover to a slave if the master dies</div><div>3) slave becoming my new master</div><div>4) old master to be recovered manually, so it becomes new slave.</div><div><br></div><div>So far I can successfully do #1 thru #3, but struggle when it comes to fixing the old master so it becomes the slave of the current master.</div><div><br></div><div>Suppose the situation where master dies and slave takes over:</div><div><br></div><div><div> node_id |     hostname     | port | status | lb_weight |  role</div><div>---------+------------------+------+--------+-----------+---------</div><div> 0       | devdb1.lan       | 5432 | 3      | 0.500000  | standby</div><div> 1       | slave.devdb1.lan | 5432 | 2      | 0.500000  | primary</div><div>(2 rows)</div></div><div><br></div><div>After failover, node_id=1 holds the VIP, it has read/write access to underlying DB and all is good.</div><div><br></div><div>I bring up the old master and want to make it a slave:</div><div><br></div><div>root@slave:/ pcp_recovery_node -d 300 localhost 9898 postgres postgres 0<br></div><div><br></div><div>as soon as that's done, the status changes to the following:</div><div><br></div><div><div> node_id |     hostname     | port | status | lb_weight |  role</div><div>---------+------------------+------+--------+-----------+---------</div><div> 0       | devdb1.lan       | 5432 | 2      | 0.500000  | primary</div><div> 1       | slave.devdb1.lan | 5432 | 2      | 0.500000  | standby</div></div><div><br></div><div>and all the hell breaks loose, as pgpool does this:</div><div><br></div><div><div>Feb  9 10:29:11 slave pgpool[1765]: failover_handler called</div><div>Feb  9 10:29:11 slave pgpool[1765]: failover_handler: starting to select new master node</div><div>Feb  9 10:29:13 slave pgpool[1765]: failover: set new primary node: 0</div><div>Feb  9 10:29:13 slave pgpool[1765]: failover: set new master node: 0</div></div><div><br></div><div>without telling the actual master that it should become a slave, so now i have two servers, which think they are masters. </div><div><br></div><div>I have searched the forums and found one similar question unanswered, while the other was answered back in 2010, saying that the "next version of pgpool will be able to deal with the problem" (<a href="http://lists.pgfoundry.org/pipermail/pgpool-general/2010-November/003034.html" target="_blank">http://lists.pgfoundry.org/pipermail/pgpool-general/2010-November/003034.html</a>). </div><div><br></div><div>What am I missing here?</div><div><br></div><div><br></div><div><br></div><div>Thanks,</div><div>Aistis</div><div> <br></div><div><br></div></div>
</div><br></div>