<div dir="ltr">I&#39;m sorry, I forgot to reply the list!<br><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Attila Heidrich</b> <span dir="ltr">&lt;<a href="mailto:attila.heidrich@gmail.com">attila.heidrich@gmail.com</a>&gt;</span><br>

Date: 2014-03-03 14:37 GMT+01:00<br>Subject: Re: [pgpool-general: 2561] Re: pgpool-wd problems adding a third backend node<br>To: Yugo Nagata &lt;<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>&gt;<br><br><br>

<div dir="ltr"><div><div><div><div><div>Thanks a lot, the tutorial is really great and clean.<br><br></div>I use load_balace mode, not master/slave mode, but this should not change very much of my problem.<br><br><br></div>


I have framed the problem a bit:<br><br></div>When pgpool starts the pgpool_remote_start script, it never returns. After the end of the scripts, pcp_recovery_node waits until the end of time.<br><br>Running the script by hand always work.<br>


<br>postgres@pool-1:~$ /usr/sbin/pcp_recovery_node -d 0 localhost 9898 postgres DifficultPassword 2<br>DEBUG: send: tos=&quot;R&quot;, len=46<br>DEBUG: recv: tos=&quot;r&quot;, len=21, data=AuthenticationOK<br>DEBUG: send: tos=&quot;D&quot;, len=6<br>


<br></div><div>... and just waits forever...<br><br></div><div>Meanwhile the remote postgresql DB is up and running:<br><br>postgres@pool-3:~$ /usr/lib/postgresql/9.3/bin/pg_ctl -w -D /var/lib/postgresql/9.3/main/ status<br>


pg_ctl: server is running (PID: 8780)<br><br><br></div><div>The pgpool_remote_start script is:<br>postgres@pool-1:~$ /var/lib/postgresql/pgpool_remote_start pool-3 /var/lib/postgresql/9.3/main/<br>waiting for server to start....2014-03-03 14:33:50 CET LOG:  database system was shut down at 2014-03-03 14:33:42 CET<br>


2014-03-03 14:33:50 CET LOG:  database system is ready to accept connections<br>2014-03-03 14:33:50 CET LOG:  autovacuum launcher started<br> done<br>server started<br>2014-03-03 14:33:51 CET LOG:  received SIGHUP, reloading configuration files<br>


Connection to pool-3 closed.<br>postgres@pool-1:~$<br><br></div><div>Here is the script text:<br>----------------------<br>#!/bin/sh<br><br>/usr/bin/logger Called &quot;$0&quot; &quot;$*&quot;<br><br>DEST=$1<br>DESTDIR=$2<br>


PGCTL=&quot;/usr/lib/postgresql/9.3/bin/pg_ctl&quot;<br><br>COMMAND=&quot;ssh -t postgres@$DEST &#39;$PGCTL -w -D $DESTDIR start&#39;&quot;<br>/usr/bin/logger -- Trying &quot;$COMMAND&quot;<br>eval $COMMAND<br></div><div>


----------------------<br><br><div>I can do some kind of no-so-live recovery, If I manually follow the steps:</div><div><br></div><div>stop PG on node-x</div><div><div>call copy_basebackup</div><div>call pgpool_remote_start</div>


<div>call pcp attach_node</div></div><div><br></div><div>I can repeat it for any node, and works, the problem is, that I do not know how to handle consistency during the node recovery.</div><div><br></div><br></div>Attila<br>

<br></div>p.s. I use GlusterFS to share some data, like script texts among the servers, and keep WAL logs safe, it is very handy, I can say!<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-24 13:05 GMT+01:00 Yugo Nagata <span dir="ltr">&lt;<a href="mailto:nagata@sraoss.co.jp" target="_blank">nagata@sraoss.co.jp</a>&gt;</span>:<div><div class="h5">

<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi,<br>
<br>
If you are using pgpool with master-slave mode and streaming-replication,<br>
the tutorial may be helpful to setup.<br>
<a href="http://www.pgpool.net/pgpool-web/contrib_docs/watchdog_master_slave/en.html" target="_blank">http://www.pgpool.net/pgpool-web/contrib_docs/watchdog_master_slave/en.html</a><br>
<br>
This includes scripts for online-recovery configuration.<br>
<br>
To add 3rd backend, what you need to do are:<br>
1) Install PostgreSQL to the 3rd server. postgres should be stopped.<br>
2) Add the backend information to all pgpools&#39; pgpool.conf.<br>
3) Reload all pgpools (You don&#39;t need to restart them.)<br>
 $ pgpool reload<br>
4) Do online-recovery at one pgpool.<br>
 $ pcp_recovery 0 localhost 9898 user pass 2<br>
<br>
If this doesn&#39;t work, please infrom the actual operation which you did<br>
and all pgpool.conf and their log messages.<br>
<div><div><br>
On Tue, 11 Feb 2014 16:13:08 +0100<br>
Attila Heidrich &lt;<a href="mailto:attila.heidrich@gmail.com" target="_blank">attila.heidrich@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Sorry for the mistypings, the correct inserted section is:<br>
&gt; backend_hostname2 = &#39;pool-3&#39;<br>
&gt; backend_port2 = 5433<br>
&gt; backend_weight2 = 1<br>
&gt; backend_data_directory2 = &#39;/var/lib/postgresql/9.3/main/&#39;<br>
&gt; backend_flag2 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;<br>
&gt; After once this operation killed the replication, I can not easily ever<br>
&gt; start it again with just two nodes either.<br>
&gt;<br>
&gt; and a different question: how the configurations of the pools being<br>
&gt; clustered will be replicated? Is the only way doing it by hand?<br>
&gt;<br>
&gt; [[ pgpooladmin for example doesn&#39;t do anything with the configs on the<br>
&gt; failover pgpools. It cannot even detect if pgpool is running, or not, but I<br>
&gt; guess this is because the pid file is not created at all, which is a<br>
&gt; problem too, but I don&#39;t really care pgpooladmin at the moment. ]]<br>
&gt;<br>
&gt;<br>
&gt; Attila<br>
&gt;<br>
&gt;<br>
&gt; 2014-02-11 15:21 GMT+01:00 Attila Heidrich &lt;<a href="mailto:attila.heidrich@gmail.com" target="_blank">attila.heidrich@gmail.com</a>&gt;:<br>
&gt;<br>
&gt; &gt; Dear All!<br>
&gt; &gt;<br>
&gt; &gt; I have read many docs, but still have totally silly problems, like the<br>
&gt; &gt; following:<br>
&gt; &gt;<br>
&gt; &gt; I run two Debian 7.3 boxes, with postgresql 9.3 and pgpool 3. on each.<br>
&gt; &gt; I use  pgpool&#39;s own wd mech.<br>
&gt; &gt;<br>
&gt; &gt; It seems to work fine in this scenario, but everything fails when I add a<br>
&gt; &gt; 3rd backend node.<br>
&gt; &gt;<br>
&gt; &gt; I just insert the following section into both pgpool.conf:<br>
&gt; &gt;<br>
&gt; &gt; backend_hostname2 = &#39;pool-3&#39;<br>
&gt; &gt; backend_port1 = 5433<br>
&gt; &gt; backend_weight1 = 1<br>
&gt; &gt; backend_data_directory1 = &#39;/var/lib/postgresql/9.3/main/&#39;<br>
&gt; &gt; backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt; &gt;<br>
&gt; &gt; after the first and the second, which are the same, just with<br>
&gt; &gt; backend_hostname0 = &#39;pool-1&#39;, and backend_hostname1 = &#39;pool-2&#39;<br>
&gt; &gt; respectively. pgpool replication works with the two nodes.<br>
&gt; &gt;<br>
&gt; &gt; Stop pgpools<br>
&gt; &gt; Stop database<br>
&gt; &gt; rsync the master database to the 3rd node (I would like to have online<br>
&gt; &gt; sync, but always got backend_error, so I have decided to start with offline<br>
&gt; &gt; sync)<br>
&gt; &gt; start all databases<br>
&gt; &gt; start pgpool#1<br>
&gt; &gt; start pgpool#2 (I have experienced that starting at once doesn&#39;t make any<br>
&gt; &gt; sense, it usually doesn&#39;t work such way, some, or all of the pgpool nodes<br>
&gt; &gt; should be restarted)<br>
&gt; &gt;<br>
&gt; &gt; And pgpool stops replicating, although the pools see each other, wd seems<br>
&gt; &gt; to work.  Any DB operation goes only the db on the active pool node.<br>
&gt; &gt;<br>
&gt; &gt; What do I do wrong??<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt;<br>
&gt; &gt; Attila<br>
&gt; &gt;<br>
<br>
<br>
</div></div><span><font color="#888888">--<br>
Yugo Nagata &lt;<a href="mailto:nagata@sraoss.co.jp" target="_blank">nagata@sraoss.co.jp</a>&gt;<br>
</font></span></blockquote></div></div></div><br></div>
</div><br></div></div>