Daniele Brunengo
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.
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.
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)?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hosted sites, use content management system, wordpress, joomla, etc.
The config is managed through a DB as noci referenced, db replication/clustering could/would .....
The config is managed through a DB as noci referenced, db replication/clustering could/would .....
ASKER
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.
so The amount of data written to logs can be an indication.
ASKER
Clustering was actually the way to go.
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).