Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th April 2011, 14:37
ncoc.nl ncoc.nl is offline
Member
 
Join Date: Feb 2011
Posts: 36
Thanks: 3
Thanked 17 Times in 11 Posts
Lightbulb Server failover by mirroring

Hi everyone,

I know this question is asked before but I want to realize some kind of failover in case of a servercrash, I did some research and testing already and noticed that most of the MySQL data is copied/mirrored to the second server.

What I did till now:
Install server 1 in normal mode
Install server 2 in expert mode and setup the replication with server 1
The installation of server 2 is a full install, this means that I also installed the web interface
Important: the testing is only done from the server 1 interface, as mentioned in the manual, normally there is only 1 management interface

It all works fine and most of the data is mirrored on the 2nd server.

The following parts are not replicated:
CP Users
- add user
- edit user
Monitor
- System overview
- CPU info
Sites
- Statistics
Client
- Template

This is normal because this is done localy

However, the goal is to create a perfect mirror which can run in no time when the primary (server 1) is down. To configure the mirror I installed the management console in case the first server is really dead and the webserver should be up in a short time

The question: what are the things I have to pay notice to, are there part which can give problems and does anyone tried this before and have some idea's

Please give some feedback, this week I will try to finish the combination and present some kind of manual (if it will work of course )
Reply With Quote
Sponsored Links
  #2  
Old 18th April 2011, 10:04
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,006
Thanks: 826
Thanked 5,377 Times in 4,224 Posts
Default

There is only 1 management interface, so the data you mentioned above is not mirrored to the slave. Entering the interface on the second server will break the replications, so do not install a interface on the second server.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 18th April 2011, 15:26
ncoc.nl ncoc.nl is offline
Member
 
Join Date: Feb 2011
Posts: 36
Thanks: 3
Thanked 17 Times in 11 Posts
Question

Till,

I'll try to make my questions more clear, I've read the manual and know that it is not the way it should be.

However, the intension is to have some kind of "backup" CP and server, this one can not be used for managing the server(s), the management must be done from (and ONLY from) the primary (this last comment is for who want to try this anyway, it WILL break your server replication)

When replicating the missing DB items to the secondary, is it possible to reconfigure the secondary and use this one to manage in case of a crash.
There are situations that a server is really dead and it can't be repaired, in that case your management server is gone, what to do to re-establish the management server for managing the other server(s)?

What I want to accomplish is creating a mirror combination, more like somekind of failover without using gluster, I've used it and when the servers are not physical on the same network (internet replication) it's "not done", the response can take 5 seconds of more and every change is a re-write of the MySQL DB.

When the managementserver is down and for some reason must be rebuild, how can I re-establish the management console?

I did read the forum(s) and manual, but I can't find a proper solution in case of a management server crash, maybe I missed something?

Regards,
Ronald
Reply With Quote
  #4  
Old 18th April 2011, 15:40
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,006
Thanks: 826
Thanked 5,377 Times in 4,224 Posts
Default

This is a one way replication, from master to slave. This implies that the slave can not be used as master. If you would change or add a single record on the slave, it would break the amster as there will be a ID conflict in the database then. So you can not use the slave as master server. When the amster is down, the salve will work without interruption, but you can not change the configuration trough the ispconfig interface until the master is up again.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 19th April 2011, 08:01
i-chat i-chat is offline
Member
 
Join Date: Jan 2011
Posts: 31
Thanks: 3
Thanked 0 Times in 0 Posts
Default

i understand, i think what ncoc.nl whats should be considered i an other method. master / domain replications - should however be a feature that is high on the priority list.

one if the easiest ways to do this would be to create a 3 steps plan.

a > create a full confige backup + restore function for all master settings.
b > create live full master / slaved master (note the name) replication.
c > authority conversion / management.

how:
A> the backup part is fairly easy and doesn't require mutch explaination.
B> this is what is discused in this topic ...
C> this is the way how to make this actually work. (ill explain herunder)


Case: you have a webhosting company with an ISPconfig cluster (or multiserver setup). with 1 master server. (single point of failure).

now for any reason you maste server dies on you, i can be a routing issue, or a hardware failure on its side - or any other problem that might happen.
what you want to do is to. get that server (service) up an running
ASAP = T-0 (*TEN minutes ago). -
In general Best Practice (tm) that would mean, 'running a failover' an exact coppy that could step in as soon as your router change the routing from %old internal ip% to %new internal ip%

if anything would require you to change any functions, scripts locations or other, on the member servers to 'promote' the enslaved master to the real master state, this should be done by a single command protected by the master password send to each server via the remote api.

i would dare saying that in 'the real webhosting world' this is wone of the highest profile feature requests, i have come accros in these forums. it could (and should) be advertised as one of THE most important new features for the release its implemented in... and a suggestion would be to make that the "next 'major' version (not just any bugfix release)"


for tips trick, best practices and more, send me a pm, email or just find me on irc.freenode.net
Reply With Quote
  #6  
Old 19th April 2011, 10:26
ncoc.nl ncoc.nl is offline
Member
 
Join Date: Feb 2011
Posts: 36
Thanks: 3
Thanked 17 Times in 11 Posts
Default

I think I-chat make my point more clear, this is what i want to accomplish.

Still working on it....

Regards,
Ronald
Reply With Quote
  #7  
Old 19th April 2011, 10:39
i-chat i-chat is offline
Member
 
Join Date: Jan 2011
Posts: 31
Thanks: 3
Thanked 0 Times in 0 Posts
Default

@ncoc.nl - we may have simular interests, and i even though im not a programer or phpcoder - we migt want to get in touch, if your a member of Webhostingtalk (nl) - you might want to get in touch with me there - tip (tweakers.net lets you send email to me also)



ill be seeing your mail and or dm on the wht forum soon - i hope..

Last edited by i-chat; 19th April 2011 at 11:10.
Reply With Quote
  #8  
Old 19th April 2011, 11:05
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,006
Thanks: 826
Thanked 5,377 Times in 4,224 Posts
Default

Quote:
now for any reason you maste server dies on you, i can be a routing issue, or a hardware failure on its side - or any other problem that might happen.
what you want to do is to. get that server (service) up an running
ASAP = T-0 (*TEN minutes ago). -
In general Best Practice (tm) that would mean, 'running a failover' an exact coppy that could step in as soon as your router change the routing from %old internal ip% to %new internal ip%
This is nothing that needs any additional implementation or changes in ispconfig, as you use virtualisation for that. Simply run the ispconfig master as vm instance, this makes backups easy and offers all kind of failover functions.

I use this setup on my systems for years now. As a "real webhsoter", you would run the master as dedicated system in a vm for security reasons anyway.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.

Last edited by till; 19th April 2011 at 11:08.
Reply With Quote
  #9  
Old 19th April 2011, 11:20
i-chat i-chat is offline
Member
 
Join Date: Jan 2011
Posts: 31
Thanks: 3
Thanked 0 Times in 0 Posts
Default

running a complet webserver (cluster) inside a vmware farm fixes this indead, but at the cost of quite a lot of resources -

I know because i have done stuf like it before with vcenter and another operationg system, (but that doens't matter mutch)


if it requires any patches to the code to create such a 'slaved master server' and/or to to upgrade a server to that role in a live setup. ill be happy to help, document and/or support the effort.

whether this could be done by a virtualisation hack or not, isn't at all relevant in my book. nor should it be..

Last edited by i-chat; 19th April 2011 at 11:23.
Reply With Quote
  #10  
Old 19th April 2011, 11:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,006
Thanks: 826
Thanked 5,377 Times in 4,224 Posts
 
Default

Quote:
running a complet webserver (cluster) inside a vmware farm fixes this indead, but at the cost of quite a lot of resources -
I'am not talking about vmware. VMware is a resource hog and not suitable for hosting services. For such a setup on a Linux servers you use software like OpenVZ which has nearly no computing overhead.

Quote:
if it requires any patches to the code to create such a 'slaved master server' and/or to to upgrade a server to that role in a live setup. ill be happy to help, document and/or support the effort.
You dont seem to understand the problems involved with that and why there can not be two masters. The problem is a general logical problem with unique ID's in clusters. If you have database (a) and database (b) and every database insert data, the the numerical ID's are unique for the database but will collide with the other database. So you can insert data only on one master at a time.

There are several solutions for that, and all are related to the server setup without changes needed in ISPConfig. The most commonly used today is virtualisation. Another solution is to use mysql cluster as backend (see mysql homepage) instead of a single mysql database for the master server, so that you can install more then one frontend. Another alternative is to work with a mysql master-master replication between two interfece servers.

As you see, thats all a question on how you configure your servers.

Quote:
whether this could be done by a virtualisation hack or not, isn't at all relevant in my book. nor should it be..
Using virtualisation is the best way to do it and not a hack.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
server failover mirroring

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Ping over VPN RoMiONeT Server Operation 2 4th July 2010 00:19
FTP cannot open remote folder!?! andysm849 Server Operation 23 16th October 2008 23:34
Problem with keeping Apache alive bobeq Server Operation 3 29th November 2007 16:11
Rejecting outbound mail tristanlee85 General 11 20th May 2007 17:04
Problems with Postfix Mysql Courier PatrickAdrichem Installation/Configuration 3 13th April 2007 15:44


All times are GMT +2. The time now is 06:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.