Link to home
Start Free TrialLog in
Avatar of Daniele Brunengo
Daniele BrunengoFlag for Italy

asked on

Sync two Centos 6 web servers

Hello, I am about to configure a backup server to my main hosting server.

The main server is a Centos LAMP gigabit server hosting many websites, they are enough now to allow me to afford a backup server.

So, I was wondering, is there a smart, fast way to keep two Centos 6 servers synchronized? I mean everything, from packets to settings and so on, not only website folders and databases.

Is there a way to automatize such a thing, or am I dreaming? Are there ways that almost get there, at least?

Thanks.
Avatar of noci
noci

This is where puppet etc. come to play.   Problem is puppet & co helps when handling any amount of servers > 1, except that the amount of work involved in maintaining the puppet env. doesn't pay off for a small amount of servers.

What can help is the have all data on DRBD volumes. (that will at least keep the dynamic data synchronised, and failover etc. can be handled using keep alive..., and volumes can be active/active if you applications support that).

For the software side of things (package management) you really need  local setups and update both sides.
If all settings that need to equal are also on a drbd volume (you can have multiple) f.e. using symlinks than the will stay equal as well.

Notable exceptions would be Network settings, as they identify the systems they NEED to be kept SEPARATE.
so /etc/ cannot be on a drbd volume....  same fo /bin  & /sbin as the would be the basic software.
If you are using the systemd startup tooling then /usr cannot be shared as well.  (as systemd distro's tends to blend /bin /sbin /usr/bin & /usr/sbin).     (/usr was in pre-systemd presumed to be on a shared volume (nfs, etc) ,  except that systemd-developers thought that wasn't needed from a disk-size perspective and broke the rules on that).
Avatar of Daniele Brunengo

ASKER

It's as I feared. Too much hassle for two servers, probably. I guess it's more convenient to just keep the servers manually synced as far as settings go, and use rsync to sync files for the www folder.

Is there a way to keep two mysql servers in sync, though? Or will I have to resort to database dumps (which I currently do automatically every 6 hours)?
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hosted sites, use content management system, wordpress, joomla, etc.

The config is managed through a DB as noci referenced, db replication/clustering could/would .....
Yes, I know, I built all the websites on the server. So probably clustering Mysql would be the solution. But do you know if it takes up a lot of bandwidth?
That depends on the amount of updates. Only the logs changes are sent across and processed.
so The amount of data written to logs can be an indication.
Clustering was actually the way to go.