[pgpool-general: 7190] Re: The best way to enable PgPool and PostgreSQL server start automatically in the Pgpool + WatchDog Mode

Bo Peng pengbo at sraoss.co.jp
Tue Aug 11 23:47:02 JST 2020


Hi,

On Sun, 9 Aug 2020 17:05:01 +0800
"J.L." <wantdrink at gmail.com> wrote:

> Hi there,
> 
> I've installed pgpool 4.1.2 and postgresql 12.3 with watchdog based on
> https://www.pgpool.net/docs/latest/en/html/example-cluster.html.
> That is 3 machines with a VIP, pgpool service + watchdog service +
> postgresql service running on each of them, 1 primary + 2 standby
> postgresql.
> The question is: is that possible to enable those services as auto started
> even if I reboot all of them?
> 
> I checked running services on them:
> 
> [root at primary ~]# systemctl status postgresql-12
> > postgresql-12.service - PostgreSQL 12 database server
> >    Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service;
> > disabled; vendor preset: disabled)
> >    Active: active (running) since Thu 2020-07-02 22:17:35 CDT; 1 months 6
> > days ago
> >
> > [root at secondary1 ~]# systemctl status postgresql-12
> > postgresql-12.service - PostgreSQL 12 database server
> >    Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service;
> > disabled; vendor preset: disabled)
> >    Active: inactive (dead)
> >
> > [root at secondary2 ~]# systemctl status postgresql-12
> > postgresql-12.service - PostgreSQL 12 database server
> >    Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service;
> > disabled; vendor preset: disabled)
> >    Active: inactive (dead)
> 
> 
> So the postgresql service on secondary 1 & 2 is not started by postgresql
> service, they are triggered by pgpool with command like:
> 
> > /usr/pgsql-12/bin/postgres -D /var/lib/pgsql/12/data

Sorry, I could not understand the configuration.
May I ask how you configure pgpool to execute command above?

> And on the primary the ps aux shows
> 
> > /usr/pgsql-12/bin/postmaster -D /var/lib/pgsql/12/data/
> 
> 
> Which means I can enable pgpool service on all 3 machines:
> 
> > systemctl enable pgpool
> 
> 
> But shouldn't do the same for postgresql service like systemctl enable
> postgresql-12.
> Also I'm not sure if enabling services to start automatically will lead to
> any issue.
> 
> Any suggestion or guidance about this is appreciated. I just want to make
> the DB system recover even after rebooting.
> 
> Thanks.


-- 
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS, Inc. Japan


More information about the pgpool-general mailing list