Thread: Error since powerouttage

Error since powerouttage

From
"Daniel E. Fisher"
Date:
Running a RH 9 system with postgres 7.3.2-3

I come back after vacation and my system shutdown cause of a powerouttage on
the block.

I restart and i get this trying to access the database:
"Warning: pg_connect() unable to connect to PostgreSQL server: could not
connect to server: Connection refused Is the server running on host
database.lhasi.org and accepting TCP/IP connections on port 5432? in
/var/www/html/dealingwithcrohns/phpBB2/db/postgres7.php on line 79
phpBB : Critical Error

Could not connect to the database"


If someone could help me that be great.

I don't believe I saw postgres start on startup...but don't I have to start
it by the pgsql user?

-Dan


Re: Error since powerouttage

From
Bruno Wolff III
Date:
On Tue, Jan 13, 2004 at 14:08:14 -0500,
  "Daniel E. Fisher" <danfisher@bwkip.com> wrote:
> Running a RH 9 system with postgres 7.3.2-3
>
> I come back after vacation and my system shutdown cause of a powerouttage on
> the block.
>
> I restart and i get this trying to access the database:
> "Warning: pg_connect() unable to connect to PostgreSQL server: could not
> connect to server: Connection refused Is the server running on host
> database.lhasi.org and accepting TCP/IP connections on port 5432? in
> /var/www/html/dealingwithcrohns/phpBB2/db/postgres7.php on line 79
> phpBB : Critical Error
>
> Could not connect to the database"
>
>
> If someone could help me that be great.
>
> I don't believe I saw postgres start on startup...but don't I have to start
> it by the pgsql user?
>
> -Dan

What might have happened is that some other service started during the reboot
that was previously used by the postgres postmaster before the outage.
This would prevent postgres from starting up.

You can avoid this by removing the pid file on reboot, but you want to make
sure that this only gets done on reboots, not service level changes or
you may end up with two postmasters running and trash your database.

The init script for postgres should handle starting it as the correct user.

Re: Error since powerouttage

From
Bruno Wolff III
Date:
On Tue, Jan 13, 2004 at 14:50:25 -0500,
  "Daniel E. Fisher" <danfisher@bwkip.com> wrote:
> Well...

Its a good idea to keep these discussions on list, so that other people
can contribute.

>
> I removed the pid from here /var/lib/pgsql/data/
> rebooted
> I did see postgresql start this time but still getting that error

Was this the first time it was started by the start up script?
One possibility is that it is only listening on domain sockets or
on some other socket than 5432. But if this is the case now, I would
wonder how it worked previously. Unless you manually started it correctly.

>
> -Dan
>
> -----Original Message-----
> From: Bruno Wolff III [mailto:bruno@wolff.to]
> Sent: Tuesday, January 13, 2004 2:26 PM
> To: Daniel E. Fisher
> Cc: PGSQL List
> Subject: Re: [GENERAL] Error since powerouttage
>
>
> On Tue, Jan 13, 2004 at 14:08:14 -0500,
>   "Daniel E. Fisher" <danfisher@bwkip.com> wrote:
> > Running a RH 9 system with postgres 7.3.2-3
> >
> > I come back after vacation and my system shutdown cause of a powerouttage
> on
> > the block.
> >
> > I restart and i get this trying to access the database:
> > "Warning: pg_connect() unable to connect to PostgreSQL server: could not
> > connect to server: Connection refused Is the server running on host
> > database.lhasi.org and accepting TCP/IP connections on port 5432? in
> > /var/www/html/dealingwithcrohns/phpBB2/db/postgres7.php on line 79
> > phpBB : Critical Error
> >
> > Could not connect to the database"
> >
> >
> > If someone could help me that be great.
> >
> > I don't believe I saw postgres start on startup...but don't I have to
> start
> > it by the pgsql user?
> >
> > -Dan
>
> What might have happened is that some other service started during the
> reboot
> that was previously used by the postgres postmaster before the outage.
> This would prevent postgres from starting up.
>
> You can avoid this by removing the pid file on reboot, but you want to make
> sure that this only gets done on reboots, not service level changes or
> you may end up with two postmasters running and trash your database.
>
> The init script for postgres should handle starting it as the correct user.
>