?
Solved

Does rsync make an exact mirror between servers

Posted on 2010-09-08
15
Medium Priority
?
579 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
15 Comments
 
LVL 19

Expert Comment

by:jools
ID: 33626082
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
ID: 33626143
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 40

Expert Comment

by:noci
ID: 33626571
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
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 

Author Comment

by:rawandnet
ID: 33628980
- do you mean clustering MySQL or whole server?
- is it difficult to configuring cluster on Linux?
0
 
LVL 40

Expert Comment

by:noci
ID: 33631376
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
ID: 33659933
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 40

Expert Comment

by:noci
ID: 33660493
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
 

Author Comment

by:rawandnet
ID: 33660581
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 40

Expert Comment

by:noci
ID: 33660793
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
ID: 33661236
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 40

Expert Comment

by:noci
ID: 33661302
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
ID: 33661995
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 40

Accepted Solution

by:
noci earned 2000 total points
ID: 33662237
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 40

Expert Comment

by:noci
ID: 33662369
0
 

Author Closing Comment

by:rawandnet
ID: 33679890
thanks for you information
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
Suggested Courses

762 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