By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,933 Members | 1,676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,933 IT Pros & Developers. It's quick & easy.

Errors after power failure

P: n/a
After a powerfailure of 10hours I have got my database server back up and
the phpBB2 that a site uses is not working. Here is the error.

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

The machine is a RH9 box with the latest postgres running from redhat update.

I have webmin on the machine which shows the databases there but i keep
getting this error
The machine didn't come up with any errors or bad blocks with the auto fsck
so i am confused.

Can anyone help?

-Dan
I am patient...its the other guys you gotta blame ;)

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 22 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Sounds like you just need to delete /usr/local/pgsql/data/postmaster.pid
or /var/lib/pgsql/data/postmaster.pid and exectute service postgresql start.

J

da*******@bwkip.com wrote:
After a powerfailure of 10hours I have got my database server back up and
the phpBB2 that a site uses is not working. Here is the error.

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

The machine is a RH9 box with the latest postgres running from redhat update.

I have webmin on the machine which shows the databases there but i keep
getting this error
The machine didn't come up with any errors or bad blocks with the auto fsck
so i am confused.

Can anyone help?

-Dan
I am patient...its the other guys you gotta blame ;)

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #2

P: n/a
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to rebuild
the server the last time this happened. Starting to be a pain.

Anyone have ideas?

-Dan

Sounds like you just need to delete /usr/local/pgsql/data/postmaster.pid
or /var/lib/pgsql/data/postmaster.pid and exectute service postgresql
start.

J

da*******@bwkip.com wrote:
After a powerfailure of 10hours I have got my database server back up
and the phpBB2 that a site uses is not working. Here is the error.

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

The machine is a RH9 box with the latest postgres running from redhat
update.

I have webmin on the machine which shows the databases there but i keep
getting this error
The machine didn't come up with any errors or bad blocks with the auto
fsck so i am confused.

Can anyone help?

-Dan
I am patient...its the other guys you gotta blame ;)

---------------------------(end of
broadcast)--------------------------- TIP 2: you can get off all lists
at once with the unregister command
(send "unregister YourEmailAddressHere" to
ma*******@postgresql.org)

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 22 '05 #3

P: n/a
Look through the postgresql log. It will tell you what's going wrong.

On Wed, Jan 14, 2004 at 05:49:57PM -0500, da*******@bwkip.com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to rebuild
the server the last time this happened. Starting to be a pain.

Anyone have ideas?

-Dan



Sounds like you just need to delete /usr/local/pgsql/data/postmaster.pid
or /var/lib/pgsql/data/postmaster.pid and exectute service postgresql
start.

J

da*******@bwkip.com wrote:
After a powerfailure of 10hours I have got my database server back up
and the phpBB2 that a site uses is not working. Here is the error.

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

The machine is a RH9 box with the latest postgres running from redhat
update.

I have webmin on the machine which shows the databases there but i keep
getting this error
The machine didn't come up with any errors or bad blocks with the auto
fsck so i am confused.

Can anyone help?

-Dan
I am patient...its the other guys you gotta blame ;)

---------------------------(end of
broadcast)--------------------------- TIP 2: you can get off all lists
at once with the unregister command
(send "unregister YourEmailAddressHere" to
ma*******@postgresql.org)

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster





---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


--
Martijn van Oosterhout <kl*****@svana.org> http://svana.org/kleptog/ (... have gone from d-i being barely usable even by its developers
anywhere, to being about 20% done. Sweet. And the last 80% usually takes
20% of the time, too, right?) -- Anthony Towns, debian-devel-announce


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFABb7nY5Twig3Ge+YRAuN9AKCsvFxqm1XOdfAFvldBOV Wan9tiiQCgt0hq
3HD8q+iakJhf+MhYs34dtC8=
=NI5/
-----END PGP SIGNATURE-----

Nov 22 '05 #4

P: n/a
On Wed, 14 Jan 2004 da*******@bwkip.com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to rebuild
the server the last time this happened. Starting to be a pain.


Firewalling maybe? Check which ports are open with nmap.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #5

P: n/a
Heres what is get with nmap localhost

pg***********@postgresql.org

[root@database root]# nmap localhost

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on database (127.0.0.1):
(The 1590 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open sunrpc
443/tcp open https
783/tcp open hp-alarm-mgr
1024/tcp open kdm
1025/tcp open NFS-or-IIS
6000/tcp open X11
10000/tcp open snet-sensor-mgmt

Nmap run completed -- 1 IP address (1 host up) scanned in 2 seconds
[root@database root]#

And I doublechecked to make sure postmaster was running
Here is what is in the log file
LOG: database system was shut down at 2004-01-15 11:22:01 EST
LOG: checkpoint record is at 0/AF6940
LOG: redo record is at 0/AF6940; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 2676; next oid: 25169
LOG: database system is ready

-Dan
On Wed, 14 Jan 2004 da*******@bwkip.com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to
rebuild the server the last time this happened. Starting to be a
pain.


Firewalling maybe? Check which ports are open with nmap.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #6

P: n/a
I would suspect the manner in which it was started. Does your postresql.conf
file have tcpip_socket=true?. If it is set to false and the script that
starts Postgres does not use the '-o -i' switch then the database will not
accept tcpip connections. Have you tried psql on the database host to see if
it can accept local connections via a unix socket?

On Thursday 15 January 2004 08:16 am, da*******@bwkip.com wrote:
Heres what is get with nmap localhost

pg***********@postgresql.org

[root@database root]# nmap localhost

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on database (127.0.0.1):
(The 1590 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open sunrpc
443/tcp open https
783/tcp open hp-alarm-mgr
1024/tcp open kdm
1025/tcp open NFS-or-IIS
6000/tcp open X11
10000/tcp open snet-sensor-mgmt

Nmap run completed -- 1 IP address (1 host up) scanned in 2 seconds
[root@database root]#

And I doublechecked to make sure postmaster was running
Here is what is in the log file
LOG: database system was shut down at 2004-01-15 11:22:01 EST
LOG: checkpoint record is at 0/AF6940
LOG: redo record is at 0/AF6940; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 2676; next oid: 25169
LOG: database system is ready

-Dan
On Wed, 14 Jan 2004 da*******@bwkip.com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to
rebuild the server the last time this happened. Starting to be a
pain.


Firewalling maybe? Check which ports are open with nmap.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


--
Adrian Klaver
ak*****@comcast.net

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #7

P: n/a
If I could kiss you I would.

Everything is working now.

Apparently an old script I had was switched and you were right...the old
script was
not starting tcp connections....so...I enabled it in the postgresql.conf and
it is ok

Thank You

-Dan

Thanks for everyones help!!

-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Adrian Klaver
Sent: Thursday, January 15, 2004 11:19 AM
To: pg***********@postgresql.org
Subject: Re: [GENERAL] Errors after power failure
I would suspect the manner in which it was started. Does your
postresql.conf
file have tcpip_socket=true?. If it is set to false and the script that
starts Postgres does not use the '-o -i' switch then the database will not
accept tcpip connections. Have you tried psql on the database host to see if
it can accept local connections via a unix socket?

On Thursday 15 January 2004 08:16 am, da*******@bwkip.com wrote:
Heres what is get with nmap localhost

pg***********@postgresql.org

[root@database root]# nmap localhost

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on database (127.0.0.1):
(The 1590 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open sunrpc
443/tcp open https
783/tcp open hp-alarm-mgr
1024/tcp open kdm
1025/tcp open NFS-or-IIS
6000/tcp open X11
10000/tcp open snet-sensor-mgmt

Nmap run completed -- 1 IP address (1 host up) scanned in 2 seconds
[root@database root]#

And I doublechecked to make sure postmaster was running
Here is what is in the log file
LOG: database system was shut down at 2004-01-15 11:22:01 EST
LOG: checkpoint record is at 0/AF6940
LOG: redo record is at 0/AF6940; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 2676; next oid: 25169
LOG: database system is ready

-Dan
On Wed, 14 Jan 2004 da*******@bwkip.com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to
rebuild the server the last time this happened. Starting to be a
pain.


Firewalling maybe? Check which ports are open with nmap.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


--
Adrian Klaver
ak*****@comcast.net

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.