Recently, a provider I colo with had yet another outage, but this was an unusually long and very annoying outage.
They haven’t supplied any ‘reasonable’ explanation for it, so I’ll assume incompetence is the cause and they’ll insert whatever excuse for that will seem plausible.
Anyway, throughout the downtime, I was considering – how could I ensure high availability, the colo provider I am with is generally about 97% available. My home internet connection – no kidding, serves better speeds, and is 100% available.
So, at this time I started to think I can do a better job hosting the thing myself, the colo provider, whilst the prices are short of justified, they are cheap enough that what little value comes from the sites hosted, covers there cost. I can still do a better job hosting it over a connection that costs less.
I don’t plan to pull the server out, as I still have the invisible, and perhaps invalid perception that the colocation is going to be better. So, High Availability hosting crossed my mind. I can do that.
I now mirror the database from the live server to my connection, and due to the nature of the updates, the usage should not be significant. I also have MySQL replication back to that database, so that in the event the dedicated server is down, the database locally can be changed, and those changes will replicate back to the live server when it comes back.. In the event a future 8 hour or more ‘incompetence’ outage occurs.
The stumbling blocks that I have to jump over are:
– File management. How do I mirror those on both servers.. It’s likely only the server ones will change, but I still need to mirror those to the home server.
– DNS. I can manage this easily – by having multiple A records. Though, I would prefer to have something like the MX method, where you specify priorities, and the host is contacted in each order.
My thoughts on file management, at least for now, will involve some sort of check, to see when files are changed, and then mirror all changed files again. This way, we maintain sync of the files.
The DNS issue, it’s not a large issue, as I think I will just have two A records, and this will point at both IPs, then its just random as to which location is reached. Of course, during an outage, the down A records are removed, which would make only the ‘up’ site respond – high availability.
Mail is already OK for the sites concerned.
I’m not doing all the sites at the moment, I still have some PHP items to sort on the home server. Version checking could be a problem, if I wasn’t administering both servers – but I am, so that won’t be a problem.
Maybe I should setup the home server, see if its a success, and if it remains better than the newcastle box, the move to shut it down and remove it, and it’s associated expense could be natural. I can see latency might be an issue, but perhaps it won’t be.
One Response to MySQL Database Replication / High Availability Hosting