Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 12-07-2018, 03:40 AM   #1
LQ Newbie
Registered: May 2018
Posts: 5

Rep: Reputation: Disabled
Connection to server fails after rebooting even though can log into it

I have been having problem with the electricity going off often for 3 hours and more at a time and the UPS i have is not enough. When the UPS runs out then the servers switch off. When the electricity goes back on things boot up and all servers and VM's go on automatically (running XenServer with a few VM's). The issue I am having is that when the servers switch back on all the VM's go on as normal but there is two webservers that rely on the database and the other 5 don't. The ones that are relying on the database (all the content housed on a FreeNas) both have this error on the live site.

**Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "192.168.xx.xx" and accepting TCP/IP connections on port 5432?'**

The first and second time i saw this error i just restarted the freeNas and then it worked as normal however now this error is back because the server switched off again because of electricity going off (and yes got better UPS so wont go off again unless the electricity is off for 5 hours).

My question is where do i start to try to fix the problem. I restarted everything one by one and then searched the error that comes up and saw a post off someone saying i should try this with no reason at all setsebool -P httpd_can_network_connect on
Old 12-07-2018, 04:50 AM   #2
Senior Member
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 2,213

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Originally Posted by whissama View Post
**Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "192.168.xx.xx" and accepting TCP/IP connections on port 5432?'**
First, connection refused means that you can connect (not a typo ) to this IP address, i.e. the kernel is running, it's attached to the network and no firewall blocks port 5432. However, no process listens for connection requests at port 5432, and the kernel actively rejects the connection by sending the client an ICMP packet.

This could be a temporary condition. Perhaps the processes on the FreeNAS take a bit longer to start up. Perhaps the FreeNAS is in the middle of a monstrous filesystem check. If so, you should be able to connect in a few minutes.

Or it's a permanent problem, and your power failure has caused a problem that prevents the server processes on the FreeNAS to start up and wait for connection requests.

You should start troubleshooting this on the FreeNAS. I believe it's essentially a FreeBSD box with special software on it, so that you should be able to log on and look around, either using its web interface or the command line. There might be a console showing that the FreeNAS can't complete its boot process, or log files that indicate why processes aren't running.


freenas, postgresql, server

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I cant boot into deepin linux even though i installed into my hp laptop bluerangerx11 Linux - Newbie 2 06-25-2015 01:54 AM
[SOLVED] Bash script commands execute even though test fails. CollieJim Linux - General 4 05-31-2014 07:31 AM
RHEL4: auditd writing to /var/log/messages even though it is disabled jgrumbles Linux - Security 5 09-21-2008 03:49 AM
No Internet connection even though YaST appears to recognize network cards LordTorgamus Linux - Networking 5 06-21-2008 01:11 PM
src2pkg fails, no install line given even though fake_install is commented out agentc0re Slackware 2 02-13-2008 06:44 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration