FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Server 3: DNS offline





alvarorojas4
The DNS of the server #3 is offline, appear this msg in the server status:
Quote:
Down - 111 - Connection refused


the problem is serious?

Thanks Smile
Bondings
Indeed. It simply needed to be restarted.

By the way, how did you post this?
mOrpheuS
Bondings wrote:
By the way, how did you post this?

Local/intermediate DNS caching probably ?
jmlworld
Bondings wrote:
By the way, how did you post this?


Yeah, both Server #3 and Frihost.com were down. I wanted to check the forums but my browser returned DNS problem report! I wonder he managed to post this!
Bondings
mOrpheuS wrote:
Bondings wrote:
By the way, how did you post this?

Local/intermediate DNS caching probably ?

I was thinking that he might have added the ip address hardcoded in a hosts file. Of course caching could be it too.
cr3ativ3
Ya, I was gonna try posting at topic while it was down... I simply visited http://[server-ip]/~frih/ then tried using the login form, however the login form that I was suppose to use had a bunch of php errors.

So that was a futile attempt!

Anyways, glad to see its back online.

A suggestion I would like to add, Create a script configured as a cron job, and have it check the status of services... and if a service is down then have it automatically attempt to restart it....

Just incase the problem occurs in the future.
jmlworld
cr3ativ3 wrote:
A suggestion I would like to add, Create a script configured as a cron job, and have it check the status of services... and if a service is down then have it automatically attempt to restart it.

Just incase the problem occurs in the future.


Yeah, I agree. There's a script over http://frihost-server-status.us.to which checks if the server is up or not. So implementing another script which restarts the server once its down would be easier as I guess.

However, I think such script is not reliable and/or my need more testing before implementing it.
cr3ativ3
jmlworld wrote:
cr3ativ3 wrote:
A suggestion I would like to add, Create a script configured as a cron job, and have it check the status of services... and if a service is down then have it automatically attempt to restart it.

Just incase the problem occurs in the future.


Yeah, I agree. There's a script over http://frihost-server-status.us.to which checks if the server is up or not. So implementing another script which restarts the server once its down would be easier as I guess.

However, I think such script is not reliable and/or my need more testing before implementing it.


Sorry I meen the script I am referring to would have to (most likely) run on the server it self checking if the services are up or not and then restart the services... Otherwise you would need to setup a script on another server that can automatically login via a Remote Connection protocol such as SSH. Which could be come trouble some, and a security risk.

As to creating a script to restart the server (power cycle). That might be troublesome depending on whats happening on the server (it could cause some dataloss/ other issues.).

These script really easy to create it would take like 3 mins for someone familiar with BASH and/or Perl, to create.
alvarorojas4
Bondings wrote:
Indeed. It simply needed to be restarted.

By the way, how did you post this?

I don't know... i can enter here... but not my site

Now is fixed. Thanks!
Bondings
alvarorojas4 wrote:
Bondings wrote:
Indeed. It simply needed to be restarted.

By the way, how did you post this?

I don't know... i can enter here... but not my site

Now is fixed. Thanks!

Then I guess the dns was still cached.

Anyway, to the others, monitoring is indeed a good idea. For the server stability I was planning to restart the services anyway every few hours (temporary fix).
cr3ativ3
Bondings wrote:
Anyway, to the others, monitoring is indeed a good idea. For the server stability I was planning to restart the services anyway every few hours (temporary fix).


If you do that though, the services are gonna go down for 1 or 2 seconds every couple hours, eh I remember when the old Server 2 had that problem every 20 or 30 minutes... That was a real pain, it always seemed I was loading a page during that cycle.

Personnaly just create a small script that checks connectivity on whatever ports (80, 25, 21, etc...) if one of the services is down (80) have the script restart that service.

I am positive I could make up a script in like 5 or 10 mins, that would be able to do such a thing. If you would like me to Smile.

I may post a script in a little while to do just that, (keep this topic open).
jmlworld
cr3ativ3 wrote:
i am positive I could make up a script in like 5 or 10 mins, that would be able to do such a thing. If you would like me to Smile.

I may post a script in a little while to do just that.


cr3ativ3, you are very familiar with BASH. Can you please post a code here, so I can see how you did it?
Bondings
Any help is of course appreciated.

@cr3ativ3, yes that was indeed a real pain, although only every 3 hours (the others were caused by other things I guess). However for some reason sometimes there is huge memory (swap) usage causing very slow loading time. And restarting Apache solves it.
cr3ativ3
Bondings wrote:
However for some reason sometimes there is huge memory (swap) usage causing very slow loading time. And restarting Apache solves it.


Hey!, I have that same problem with a server I run here at home... I noticed that whenever you would download a huge file (200 Megs+) the RAM would fill up to that amount, and wouldnt subside afterwards.

I couldnt determine how to fix it, (maybe its a memory leak).

I think this occured more with the FTP Server than the HTTP Server on my machine.

jmlworld wrote:
cr3ativ3, you are very familiar with BASH. Can you please post a code here, so I can see how you did it?


I will post the script later tonight when I get time to write it, and test.
Aredon
Bondings wrote:
Anyway, to the others, monitoring is indeed a good idea. For the server stability I was planning to restart the services anyway every few hours (temporary fix).

Ahh so that explains the random 404 hiccups then. Is there any way we could get some sort of error page up to warn users that the server is restarting? Rather than getting a "does not exist"? Just a suggestion, don't know if it's possible.
cr3ativ3
Bondings wrote:
Any help is of course appreciated.

@cr3ativ3, yes that was indeed a real pain, although only every 3 hours (the others were caused by other things I guess). However for some reason sometimes there is huge memory (swap) usage causing very slow loading time. And restarting Apache solves it.


Code:

host=frih.org

if netcat -z $host 80
then
   echo "Apache is UP" # HTTP is up
else
   echo "Apache is DOWN, restarting... `date`" >> ./log # HTTP is down, restart service
fi

if netcat -z $host 443
then
   echo "Apache SSL is UP." # HTTPS is up
else
   echo "Apache SSL is DOWN, restarting... `date`" >> ./log # HTTPS is down, restart service
fi

if netcat -z $host 21
then
   echo "FTP is UP." # FTP is up
else
   echo "FTP is DOWN, restarting... `date`" >> ./log # FTP is down, restart service
fi

if netcat -z $host 53
then
   echo "DNS is UP." # DNS is up
else
   echo "DNS is DOWN, restarting... `date`" >> ./log # DNS is down, restart service
fi

if netcat -z $host 110
then
   echo "POP3 is UP." # POP3 is up
else
   echo "POP3 is DOWN, restarting... `date`" >> ./log # POP3 is down, restart service
fi


Their is the script that, checks certain services such as HTTP, HTTPS, FTP, DNS, POP3...I couldnt get it to work with SMTP it seems to hang when checking that... Wierd.

But anyways in the else segments of each check you could add the code used to restart the service...

Quote:
echo "POP3 is DOWN, restarting... `date`" >> ./log


This keeps a log of when and what is reset, so you can change ./log to whatever file you would like. I would suggest running this script ever 10 mins or atleast every 15 mins. So if a service does go down, it doesnt go down for long.

Also if you find out why the RAM usage of apache increases and fails to fall back down, and you figure out how to solve it, I would love to know as I have the same problem!

Aredon wrote:
Ahh so that explains the random 404 hiccups then. Is there any way we could get some sort of error page up to warn users that the server is restarting? Rather than getting a "does not exist"? Just a suggestion, don't know if it's possible.


Well, 404 Hiccups arent caused by Apache being restarted, because those 404 Hiccups need apache to be displayed... When apache is not live the only response you will get is something similiar to: "The connection was reset", if you are using firefox.
Bondings
Thanks for the script! This seems like a better way to check the services than most other restart scripts. Most of them (including DA I think) check if the process is still running (which was the case for named/bind), however not if it responds to connections. So if a service is still running, but not responding to connections, this script will restart it. Very Happy

I've changed the host to the ip address, considering this way it works even if named is down. And I have added the restart commands. I put it as a cron job every minute, I don't see the point in putting it less often considering it isn't a heavy script.
cr3ativ3
Bondings wrote:
Thanks for the script! This seems like a better way to check the services than most other restart scripts. Most of them (including DA I think) check if the process is still running (which was the case for named/bind), however not if it responds to connections. So if a service is still running, but not responding to connections, this script will restart it. Very Happy

I've changed the host to the ip address, considering this way it works even if named is down. And I have added the restart commands. I put it as a cron job every minute, I don't see the point in putting it less often considering it isn't a heavy script.


Ya, maybe that is why SMTP was stalling the script, because port 25 isnt suppose to respond on inbound traffic. And good idea about the IP Address.
Related topics
It would be possible to use server 3 to fix server 2.
Server 3
i wanna apply Server 3..but...
Server 3 finally open
Server 3 Hizmetinizde
Accounts from Server 2 being moved to Server 3
Server 3 Connection Refused :(
Server 3 down today (obviously fixed)
Server 3 Phpmyadmin
server 3 den server 1 e gei
server 3 joomla kuran varm
Server 2 ve Server 3 Alan Limiti 500mb'a cikarildi
Server 3 down - Server 2 challenged?
Server 3 Uptime
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.