<div dir="ltr">I'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"><<a href="mailto:attila.heidrich@gmail.com">attila.heidrich@gmail.com</a>></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 <<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>><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="R", len=46<br>DEBUG: recv: tos="r", len=21, data=AuthenticationOK<br>DEBUG: send: tos="D", 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 "$0" "$*"<br><br>DEST=$1<br>DESTDIR=$2<br>


PGCTL="/usr/lib/postgresql/9.3/bin/pg_ctl"<br><br>COMMAND="ssh -t postgres@$DEST '$PGCTL -w -D $DESTDIR start'"<br>/usr/bin/logger -- Trying "$COMMAND"<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"><<a href="mailto:nagata@sraoss.co.jp" target="_blank">nagata@sraoss.co.jp</a>></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' pgpool.conf.<br>
3) Reload all pgpools (You don'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'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 <<a href="mailto:attila.heidrich@gmail.com" target="_blank">attila.heidrich@gmail.com</a>> wrote:<br>
<br>
> Sorry for the mistypings, the correct inserted section is:<br>
> backend_hostname2 = 'pool-3'<br>
> backend_port2 = 5433<br>
> backend_weight2 = 1<br>
> backend_data_directory2 = '/var/lib/postgresql/9.3/main/'<br>
> backend_flag2 = 'ALLOW_TO_FAILOVER'<br>
><br>
> After once this operation killed the replication, I can not easily ever<br>
> start it again with just two nodes either.<br>
><br>
> and a different question: how the configurations of the pools being<br>
> clustered will be replicated? Is the only way doing it by hand?<br>
><br>
> [[ pgpooladmin for example doesn't do anything with the configs on the<br>
> failover pgpools. It cannot even detect if pgpool is running, or not, but I<br>
> guess this is because the pid file is not created at all, which is a<br>
> problem too, but I don't really care pgpooladmin at the moment. ]]<br>
><br>
><br>
> Attila<br>
><br>
><br>
> 2014-02-11 15:21 GMT+01:00 Attila Heidrich <<a href="mailto:attila.heidrich@gmail.com" target="_blank">attila.heidrich@gmail.com</a>>:<br>
><br>
> > Dear All!<br>
> ><br>
> > I have read many docs, but still have totally silly problems, like the<br>
> > following:<br>
> ><br>
> > I run two Debian 7.3 boxes, with postgresql 9.3 and pgpool 3. on each.<br>
> > I use  pgpool's own wd mech.<br>
> ><br>
> > It seems to work fine in this scenario, but everything fails when I add a<br>
> > 3rd backend node.<br>
> ><br>
> > I just insert the following section into both pgpool.conf:<br>
> ><br>
> > backend_hostname2 = 'pool-3'<br>
> > backend_port1 = 5433<br>
> > backend_weight1 = 1<br>
> > backend_data_directory1 = '/var/lib/postgresql/9.3/main/'<br>
> > backend_flag1 = 'ALLOW_TO_FAILOVER'<br>
> ><br>
> > after the first and the second, which are the same, just with<br>
> > backend_hostname0 = 'pool-1', and backend_hostname1 = 'pool-2'<br>
> > respectively. pgpool replication works with the two nodes.<br>
> ><br>
> > Stop pgpools<br>
> > Stop database<br>
> > rsync the master database to the 3rd node (I would like to have online<br>
> > sync, but always got backend_error, so I have decided to start with offline<br>
> > sync)<br>
> > start all databases<br>
> > start pgpool#1<br>
> > start pgpool#2 (I have experienced that starting at once doesn't make any<br>
> > sense, it usually doesn't work such way, some, or all of the pgpool nodes<br>
> > should be restarted)<br>
> ><br>
> > And pgpool stops replicating, although the pools see each other, wd seems<br>
> > to work.  Any DB operation goes only the db on the active pool node.<br>
> ><br>
> > What do I do wrong??<br>
> ><br>
> > Regards,<br>
> ><br>
> > Attila<br>
> ><br>
<br>
<br>
</div></div><span><font color="#888888">--<br>
Yugo Nagata <<a href="mailto:nagata@sraoss.co.jp" target="_blank">nagata@sraoss.co.jp</a>><br>
</font></span></blockquote></div></div></div><br></div>
</div><br></div></div>