[Pgpool-general] Questions about online recovery
Tatsuo Ishii
ishii at sraoss.co.jp
Sun Dec 20 09:25:45 UTC 2009
> Hi,
>
> I've a pgpool-II replication + load balance environment with seven
> backend servers running PostgreSQL 8 and CentOS 5.
>
> The backend 0 (master node) runs both pgpool-II and PostgreSQL. I'm
> setting up online recovery with rsync using the same script for both 1st
> and 2nd stage commands.
>
> Considering a scenario where the backend 0 (which runs pgpool-II and
> PostgreSQL) PostgreSQL is disconnected from pgpool-II, I have the
> following questions:
>
> * How online recovery is supposed to work in this case?
1) backend 1 is chosen as the new master node.
2) pgpool-II connects to PostgreSQL on backend 1. This connection is
different from ordinary backend connection.
3) pgpool-II requests backend 1 to execute CHECKPOINT.
4) pgpool-II requests backend 1 to execute "SELECT pgpool_recovery"
which will execute online recovery stage 1 command.
5) pgppool-II waits until all client connection disconnected.
6) pgpool-II requests backend 1 to execute CHECKPOINT.
7) pgpool-II requests backend 1 to execute "SELECT pgpool_recovery"
which will execute online recovery stage 2 command.
8) pgpool-II requests backend 1 to execute "SELECT pgpool_remote_start"
which will execute "pgpool_remote_start" script, which is supposed
to remote start postmaster on backend 0.
9) backend 0 connected again and recovery done.
> * Do I need to have pgpool-II installed on all backend servers? If so, I
> will have dummy pgpool-II processes running on backend serves just to
> have the pgpool communication manager running and be able to run
> pcp_recovery_node from another backend?
No. What you need on all backend servers are:
1) C functions under pgpool-II/sql/pgpool-recovery installed
(pgpool_recovery and pgpool_remote_start).
2) pgpool_remote_start script installed under PostgreSQL database
cluster directory (/usr/local/pgsql/data).
3) recovery scripts installed under PostgreSQL database cluster
directory (/usr/local/pgsql/data).
> * How 2nd stage of online recovery is supporsed to work if I am
> recovering from a different backend than the one running pgpool-II and
> PostgreSQL will continue accepting connections? Is cascading pgpool-II
> connections to the backend servers a correct solution or workaround
> here?
See above.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
More information about the Pgpool-general
mailing list