[program-l] Re: Website mirroring, and, failover monitoring

  • From: jacob kruger <jacob.kruger.work@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Thu, 11 Apr 2019 10:08:02 +0200

Thanks, guys.


This all makes sense, and, I think something like the master-slave configuration for mySQL will work best, and, while the code won't be changing too often, can also sort out something with the cron job to mirror it on a regular basis, etc.


The notification of server failing is also something where I think maybe a combination of that free service, or the paid-for option will be suitable, maybe with my own python code running something similar to the bash curl request remotely as backup will also be helpful, but, the last sort of obstacle will be rerouting the same domain to the alternative server ASAP - will look into that sort of thing, and, let's see.


Stay well


Jacob Kruger
Blind Biker
"Resistance is futile...but, acceptance is versatile..."

On 2019-04-10 6:20 PM, Ben Humphreys wrote:

Hi Jacob,

Here's a short bash script that will fetch your home page and if an error occurs, will send a short e-mail to a Verizon-based cell phone.
You can run it as often as you like with cron.
(I believe there are gateways similar to vtext.com for the other carriers.)

#!/bin/bash
curl 'http://site.com/index.html' > /tmp/curl.stdout 2> /tmp/curl.stderr
if [ $? -ne 0 ]; then
  mail -s "Web Server Down" 2125551212@xxxxxxxxx < /tmp/curl.stderr
fi

Ben

At 07:09 AM 4/10/2019, you wrote:
Ok, know this might come across as slightly off-topic - not related to specifically writing code, but, does relate to managing the implementation of your code, etc.


As in, wondering what forms of suggestions guys could possibly come up with when it comes to monitoring the state of a website, etc. - as in, yes, I could slap together my own python code to run on a remote/local machine, which would, at set intervals send http requests to the server, to make sure it was operating, but, would then need to decide how to let it notify someone if the server had failed/wasn't operating.


So, what form of reliable solution could you guys suggest, since would, honestly, prefer to keep it separate from something like the hosting provider themselves?


Besides that, what's the cleanest, most reliable way to do something along the lines of constantly/consistently mirror data and code across from main server to a form of backup, and, just wondering about ways to get it to take over handling operations ASAP? Almost like something along the lines of a DNS host name that maps to something like a dynamically assigned IP address, which could then be switched over to the backup machine quite quickly?  Or are there other thoughts/suggestions for something like this?


And, this relates to a linux machine running debian instance of apache web server, and mySQL databases, with PHP being the primary form of code currently being made use of.


TIA

Jacob Kruger
Blind Biker
"Resistance is futile...but, acceptance is versatile..."

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: