Solved

Does rsync make an exact mirror between servers

Posted on 2010-09-08
15
567 Views
Last Modified: 2012-08-14
Hi Guys,

I have a server that hosts our university website; the website is connected to MySQL. My question is can I user rsync  to create exact mirror  Linux  system file to another server, that server will be acting as a backup in case of primary server goes down. Can rsync  make mirror backup of running databases and new install packages? If not what is alternative?

Thanks
0
Comment
Question by:rawandnet
15 Comments
 
LVL 19

Expert Comment

by:jools
Comment Utility
It will copy the files but if the files are in use I'm not sure they would be in a good state for a recovery.

Can  you cluster?
0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Yep,
when it comes to database "mirroring" it is most probable (if not certain) that you will end up with a corrupted databe at the mirror site.
So rsync is good for flat files, but for MySQL I'd strongly recommend using its replication functionality.
Here is a comprehensive outline (part of the MySQL Reference) -
http://dev.mysql.com/doc/refman/5.0/en/replication.html
Good luck!
wmp
0
 
LVL 39

Expert Comment

by:noci
Comment Utility
The above are generalized in:

if a file is written sequentialy then it might be only partly copied when it mirrored to a different disk, (ie the remainder is still missing).
if a file is written randomly then it should be considered to be corrupted if it was accessed during the sync process as parts that have been copied, could allready have been changed.

What do you want to protect is the main question:
- loss of a disk: use a mirror raid set (raid 1)
- loss of a whole system: -
   - you can mirror f.e. using a gfs file system (off the system) and use a cluster that has multiple machines but one live instance this might still need repair (roll back until the last valid transaction).
   - you can mirror mysql (as mentioned before).
0
 

Author Comment

by:rawandnet
Comment Utility
- do you mean clustering MySQL or whole server?
- is it difficult to configuring cluster on Linux?
0
 
LVL 39

Expert Comment

by:noci
Comment Utility
Both can be done
On RHEL/CENTOS the tooling is installable. Other Distro's need a bit more work. (esp. GFS Filesystem, DLM lock manager, Enhanced LVM ), you also need a storage service (iSCSI) so the data is accessible to multiple systems.
Then you can run MySQL once on the cluster. and pull the service (+ ip address ) to a surviving system.

Otherwise you setup two MySQL instances as their failover.
0
 

Author Comment

by:rawandnet
Comment Utility
With my understanding I thought Cluster used for sharing Processing load between servers (not as redundancy).  But what you saying is Cluster used for create exact backup copy of data between two servers,  does that include making exact copy of entire linux system files between to servers (as an image), example if I install rpm package on one server cluster will to replication automatically on other server.

0
 
LVL 39

Expert Comment

by:noci
Comment Utility
How you deploy your application defines how use a cluster.

In Real life i am an admistrator for OpenVMS Clusters. (There it can be everything, there are no application worries., redundancy, failover, upgrades of systems without downtime. One of the slogans: "When downtime is not an option" is very true, and it has done so for more that 25 years.)
Applications can be run on multiple nodes at the same time using ONE dataset (files/database etc) because of the correctly enforced use of a lock manager (comparable to DLM in Linux). This locking is enforced on EVERYTHING. (In Unix there is more or less advisory locking, if someone doesn't use the locking for some file, you can access the file, But I digress).

You can have shared filesystems with Cluster filesystems like GFS, where a lockmanager is inserted by GFS to handle allocation & freeing of disk resources. (NOT access to files, but creating/removing files etc.).
If mysql could use this shared data access (by carefull locking the "right stuff") it could access one database from many systems..
The problem being that most Unix/Linux apps. don't care about locking.

AFAIK you cannot boot from a GFS filesystem, so /boot and / (minimal {tmp,bin,lib}) needs to be a local file system. The remainder could be on a GFS, and thus be shared.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:rawandnet
Comment Utility
could you please explain this a bit more:
> In Real life i am an admistrator for OpenVMS Clusters. (There it can be everything, there are no   application worries., redundancy, failover, upgrades of systems without downtime. One of the slogans: "When downtime is not an option" is very true, and it has done so for more that 25 years.)
0
 
LVL 39

Expert Comment

by:noci
Comment Utility
My professions is OpenVMS Systems Manager.

Linux/Unix systems are on the Side.
w.r.t. to creating environments where uptime requirements are above 99.999% of uptime a year (including scheduled downtime).
there is IMHO only one serious contender. OpenVMS, that OS isn't something that acquired "Clustering" shortly as an after thought.
Clustering is the heart & soul of OpenVMS.    (http://www.hp.com/go/openvms for more info).

If an application is multiuser safe (i.e. it allows concurrent sharing of resources on one system, it will allow concurrent sharing the resources on multiple systems, out of the box).  And no hassle with "fencing/stonith" with it's inevitable single point of failure.
0
 

Author Comment

by:rawandnet
Comment Utility
I agree with that OS deoesn't require Clustring, but if i install rpm package or complie source code on one server i have to do same one other server.

- then cluster can create multiple copy of date on several servers. clustring isn't only for using slave servers resources (CPU, memory..) it can be used as a failover if one server fail, is that true?
0
 
LVL 39

Expert Comment

by:noci
Comment Utility
Yes that is true if you install your software on a Cluster-Common-Filesystem.

GFS is such a filesystem.  Such a filesystem requires that all resources for thactual storage are accessible for all machines when the machines are running.  => you need an external FC- or iSCSI storagebox (SAN/NAS).
That allows multiple clients to the same "served"-device.

Those clients need to organise themselves (using a DLM f.e.) to coordinate access to shared resources.
Above that for mysql you need to ensure only one system is active and that during failover the "server" ip address is moved to the failover system.
0
 

Author Comment

by:rawandnet
Comment Utility
Although some of the word you use is totally new for me like GFS, FC and DLM, but I will try to read some about that and get some knowledge, if you have any induction links please send it to me
0
 
LVL 39

Accepted Solution

by:
noci earned 500 total points
Comment Utility
GFS is the name of a filesystem where multiple machines can access one filesystem concurrently (see also RedHat).
FC = Fibre Channel, a standard (non internet protocol) for accessing storage devices over distance.
DLM = Distributed Lock Manager (see also RedHat).
0
 
LVL 39

Expert Comment

by:noci
Comment Utility
0
 

Author Closing Comment

by:rawandnet
Comment Utility
thanks for you information
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now