[pgpool-general: 5704] Re: Restarting pgpool fails with "Address already in use" error

Bo Peng pengbo at sraoss.co.jp
Fri Aug 25 07:04:31 JST 2017


I think you should define "ExecStop" to shutdown Pgpool-II.

If no "ExecStop" is defined in service file,
Systemd will send SIGTERM (smart) to shutdown Pgpool-II.

If some connection was left, Pgpool-II will wait for all 
clients are disconnected until timeout. 
When timeout occured, Pgpool-II could not shutdown correctly,
that's the reason why starting Pgpoo-II failed.

Try to define "ExecStop" in your service file.

  ExecStop=/usr/sbin/pgpool -m fast stop


On Thu, 24 Aug 2017 12:41:36 +0430
Keyvan Hedayati <k1.hedayati93 at gmail.com> wrote:

> It's the systemd server file from Ubuntu 16.04:
> [Unit]
> Description=pgpool-II
> Documentation=man:pgpool(8)
> Wants=postgresql.service
> 
> [Service]
> User=postgres
> ExecStart=/usr/sbin/pgpool -n
> ExecReload=/bin/kill -HUP $MAINPID
> StandardOutput=syslog
> SyslogFacility=local0
> 
> [Install]
> WantedBy=multi-user.target
> 
> On Thu, Aug 24, 2017 at 8:07 AM, Bo Peng <pengbo at sraoss.co.jp> wrote:
> 
> > Hi,
> >
> > It looks that pgpool wasn't terminated correctly.
> >
> > Could you show me your service file?
> >
> > On Sun, 20 Aug 2017 15:37:19 +0430
> > Keyvan Hedayati <k1.hedayati93 at gmail.com> wrote:
> >
> > > Hello,
> > > We use pgpool for load balancing two postgres databases that has
> > replicated
> > > using streaming replication. I've only enabled load balancing feature and
> > > other options are off.
> > > When I'm trying to restart pgpool with systemctl I get an error like
> > this:
> > >
> > > Aug 20 14:34:40 Beta pgpool[16184]:  [16184] [No Connection]@[No
> > > Connection] FATAL:  failed to bind a socket: "/tmp/.s.PGSQL.5432"
> > > Aug 20 14:34:40 Beta pgpool[16184]:  [16184] [No Connection]@[No
> > > Connection] DETAIL:  bind socket failed with error: "Address already in
> > use"
> > >
> > > Seems like pgpool can not delete it's socket files so after being stopped
> > > it can't start. But socket files have full permissions:
> > > srwxrwxrwx 1 postgres postgres 0 Aug 20 14:24 /tmp/.s.PGSQL.5432
> > > srwxrwxrwx 1 postgres postgres 0 Aug 20 14:24 /tmp/.s.PGSQL.9898
> > >
> > > I've attached my configuration file.
> > > This is pgpool version I'm using which latest version if Ubuntu 16.04
> > > apparently.
> > > pgpool-II version 3.4.3 (tataraboshi)
> > >
> > > Have I configured something wrong or I've to install latest version?
> > >
> > > --
> > > Live long and prosper,
> > > K1.H <http://k1h.ir/>
> >
> >
> > --
> > Bo Peng <pengbo at sraoss.co.jp>
> > SRA OSS, Inc. Japan
> >
> >
> 
> 
> -- 
> Live long and prosper,
> K1.H <http://k1h.ir/>


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



More information about the pgpool-general mailing list