LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   2 Identical Servers : Live Backup (https://www.linuxquestions.org/questions/linux-software-2/2-identical-servers-live-backup-730366/)

vaibhavs 06-03-2009 05:58 AM

2 Identical Servers : Live Backup
 
Hi,

I have 2 identical servers (identical MBD, Processor, RAM etc).
Both have FC9 installed.

What are my options to do a LIVE backup of Primary server on to the Secondary server.

Currently I use G4L (Ghost4Linux). But for this, I need to down both server. Remove the HDD from Sec server and install it in the Pri and then boot from G4L CD and then run the backup. For a 160GB HDD, it takes 155 minutes.

Next idea, which I have not used, is do a Folder by folder RSync of the full HDD.

Are there other tools which can help me do a full HDD backup without power-down ?

Thx
Vai

irishbitte 06-03-2009 06:32 AM

rsync is really your best bet, simply because once the first backup is made, every backup after the first is an 'incremental' backup, therefore your live backup time is alot less.

vaibhavs 06-03-2009 06:55 AM

When doing a full HDD sync, there are some files & folders which I should *NOT* rsync like :
ifcfg-eth0, /etc/sysconfig/network etc

Any other files which I *SHOULD NOT* rsync.

Thx
Vai

JulianTosh 06-03-2009 07:02 AM

Have you looked into iSCSI?

I've never used it, but it's a clustering technology that might help you get'r done.

JulianTosh 06-03-2009 07:06 AM

irishbitte's suggestion allows for exclude lists so you wont overwrite system specific files. It won't work well for "live" files such as databases though. iSCSI will replicate a file system while it's in use.

If you're just concerned about replicating relatively static files, rsync is a great answer. If you're trying to replicate any kind of files that are constantly changing, iSCSI is something that needs to be looked at.

vaibhavs 06-03-2009 07:25 AM

Well I need some aspects of both toola.

I would love to replicate the entire HDD, but the problem is the IP Address, MAC address, Hostname etc will also be replicated which is not good. I will have 2 PCs with same IPs, MACs, Hostname etc which will cause conflict.

Any idea how other Sys Admins handle this ??


I have 2 plans in mind:
Use RSync for Daily or hourly backup and use iSCSI (or something similar) on weekly basis.
Bt how do I handle the IP, MAC, hostname duplication issue ?


Please advice what others are doing for backup.

BTW: I could not find much info on iSCSI on google.
Pls help me with the url of the project.

Thx
Vai

vaibhavs 06-03-2009 07:28 AM

I just did some reading on iSCSI.
Its a bit complicated for my level of tech skills :(

Need something simpler like g4L but with "Live Backup".
Any other options ?

Thx
Vai

JulianTosh 06-03-2009 07:34 AM

iSCSI is not something you run once a week. It replicates disk writes as they happen in real-time.

http://linux-iscsi.sourceforge.net/

vaibhavs 06-03-2009 07:38 AM

ah! A kind of a Raid between 2 PCs ?

JulianTosh 06-03-2009 07:50 AM

Yes. Think of it as tunneling SCSI disk writes through an IP tunnel. You can't get around having to maintain a unique OS for machines in a cluster - as far as I know. As long as both machines need to be "on", they they need their own unique configuration.

iSCSI is meant to be a poor man's SAN and replicate a separate-from-the-OS partition to a remote machine.

How you would implement this in your scenario:

1) Rebuild your two machines with the drive split up into an OS and data scheme.
2) Use iSCSI to replicate the data partition(s)

vaibhavs 06-03-2009 07:56 AM

Thx for the detailed explanation.
I understand this better now.

But what if there is a HDD failure of the main server which has the OS ?

okcomputer44 06-03-2009 07:59 AM

Just an idea.

What about the read only flag on the important files.

I mean make the first full sync to the another PC.
Then make all the important files under /etc/sysconfig, /etc/hosts, /etc/bind, etc.....(whatever you need) just to read only.(Take off the writable flag)

After that the rsync wont be able to rewrite the read only files.

Laz.

JulianTosh 06-03-2009 08:15 AM

There are many methods for disaster recovery. Each one has pros and cons and specific purpose.

If you need to have an "instant on" disaster recovery process, then RAID0 or an off-line disk replication process is your answer. With those solutions, you have pros and cons:
1) RAID0 is "expensive" because you have to purchase twice as many drives. It's quick and painless because the backups are instant.
2) Backups are cheap as you just move the data off to some other media. cons: It's an administrative pain in the butt to restore the files. Time consuming depending on the type of data you're backing up. Can be easy or difficult to restore the data in the event of a disaster, depending on what method of backup you use - tar/rsync vs. disk imaging

It sounds to me like you should just take the drive out of one machine and use the RAID0 system. The rest of the other computer could be used for spare parts, perhaps.

irishbitte 06-03-2009 06:19 PM

Jeez, this thread took off in my absence! Anyway, if you are not replicating databases, what you do when setting up rsync is you specify the files and directories that you do want backed up, rather than those you don't.

For replicating complete snapshots, perhaps you should consider Logical Volume Management or LVM: http://www.cyberciti.biz/tips/consis...snapshots.html is an idea of how this is done. I suggest testing testing testing if you are gonna use this method, but when it's working it's fantastic. An LVM snapshot can be taken at any stage, even as the system is live. The snapshot can be restored on another server, and if the main server goes down, the backup can be started almost immediately.

JulianTosh 06-03-2009 06:24 PM

Thanks, I'll have to check that out too!

vaibhavs 06-03-2009 11:51 PM

I have a good idea.
Seeking suggestions from forum members:

Any Linux Server contains 3 main component:
(a) OS specific files: OS files, Networking files etc
(b) user created files like /var/www/html, application files, config files, crontab etc
(c) Database (mysql in my case)

Backup plan:
(c) For database backup use Mysql Hotcopy twice a day.
(b) For user files use rsync twice a day for specific folders which update regularly like /var/www/html, /etc/squid, /etc/asterisk etc
(a) Since OS files seldom change, I can use a monthly g4L hdd replication.
This will also cover any files which have been changed and forgotten to be rsynced.

This way both the servers can be on at all times.
In case of failure, switchover is very simple and easy.
Only loss will be of data after the last rsync+Hotcopy and before the crash.

Awaiting member's feedback and sugestions.

Thx
Vai

PS: The only downside is while doing a g4L, both servers have to be taken down, remove HDD from backup server, install it in main server and run a g4l which takes 2 hours for me for a 160 GB hdd. If there is any tool which can do HDD mirroring between 2 PCs withuot opening, then it will be great. It will save opening up servers, removing HDDs etc for a g4l.

okcomputer44 06-04-2009 06:19 AM

Quote:

Originally Posted by irishbitte (Post 3562204)
Jeez, this thread took off in my absence! Anyway, if you are not replicating databases, what you do when setting up rsync is you specify the files and directories that you do want backed up, rather than those you don't.

For replicating complete snapshots, perhaps you should consider Logical Volume Management or LVM: http://www.cyberciti.biz/tips/consis...snapshots.html is an idea of how this is done. I suggest testing testing testing if you are gonna use this method, but when it's working it's fantastic. An LVM snapshot can be taken at any stage, even as the system is live. The snapshot can be restored on another server, and if the main server goes down, the backup can be started almost immediately.

Yeah you are right. Basically I don't know why would anyone back up the whole machine if it is just a backup.

The rsync can manage any directory(s) or files.

So he needs to make a clone spare machine then setup the rsync to sync data between the machines. (Eg.: /data1, /data2 dirs)

irishbitte 06-04-2009 06:38 AM

Yeah, I think this may be overkill, stemming from an education in virtualisation and migration of machines! It's all the rage these days, but I think it's a bit mad!
Quote:

So he needs to make a clone spare machine then setup the rsync to sync data between the machines. (Eg.: /data1, /data2 dirs)
This is exactly what the OP should do. There really is no need for the 'g4l' thing, since if you backup a corrupted system, you've got nowhere to go! Again I say to the OP, rsync is more than enough, along with mysql backups daily.

The key to getting this to work is practice. Do not find yourself in this situation having not tried out these methods! Testing testing testing, I say it again, it will pay off dividends the day your boss has you under pressure to get a machine back up and running.

vaibhavs 06-04-2009 06:44 AM

Sorry to sound dunb, but what is "OP" ??


The only reason to do a G4L once a month (or may be once in 3 months) is to accommodate OS level changes like an rpm install or soemthing of that nature. Ideally the OS level changes should be duplicated on the backup server too!!

irishbitte 06-04-2009 06:49 AM

OP = Original Poster. Personally, I think that g4l is too much, you're giving yourself work. You would be better off spending the time configuring rsync correctly, and learning how to use it. It is a very powerful tool. I agree that you may find g4l convenient.

When I want to clone a machine, I don't pull the HDD, I just use partimage, a tool included in the systemrescuecd. It still involves halting the machine. However, it works well. I partimage the partition onto an NFS server, and clone it down onto a prepared machine. Works a charm, every time.

JulianTosh 06-04-2009 06:49 AM

original post(er)

vaibhavs 06-04-2009 07:05 AM

Quote:

When I want to clone a machine, I don't pull the HDD, I just use partimage, a tool included in the systemrescuecd. It still involves halting the machine. However, it works well. I partimage the partition onto an NFS server, and clone it down onto a prepared machine. Works a charm, every time.
Actually, G4L can do the cloning that way too. I can create an image and store it on a different device and then restore it on the backup server. I have never tried it, but will do it over the weekend.

So I have decided....
RSync for daily backups and should the need arise and for safety sake, I will copy the disk image once every 3 months.

Thx a lot members for your help and imputs.
Really appreciate it.

Best regards,
Vai

irishbitte 06-04-2009 07:24 AM

Hope it goes well for you!


All times are GMT -5. The time now is 12:30 AM.