LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Best Way To Clone A Running Server? (https://www.linuxquestions.org/questions/linux-software-2/best-way-to-clone-a-running-server-515940/)

hurt138 01-03-2007 12:37 PM

Best Way To Clone A Running Server?
 
This is the situation,

I have two systems that have the same RedHat install on them. One of the boxes has had several applications (custom apps) installed and configured. Now I need to play catch up for the other system, and bring it to the same point in time.

The catch to this is that the system I need to get the info from can't be taken down for any reason.

My plan right now is to tar all the files from the root that have changed since date X. Then extract this on the 2nd system from the root it should bring it up to the same point. I am not worried about logs etc, and just want the two boxes to have the same application and configs.

Does this sound like it will work to everyone, or does anyone have a better method of cloning this running server?

trickykid 01-03-2007 01:08 PM

If you're just worried about applications and configs, first just install the new machine and install the same applications the running server has. Since it's Redhat, simply seeing the RPM packages installed by viewing the RPM database with rpm -qa will give you insight of what needs to be installed that isn't.

If you have custom applications compiled from source, etc, do those seperate or next after the RPM installs.

Then to copy configs from /etc and so on, use rsync instead of tarballs and it should sync everything up nicely.

homey 01-03-2007 04:43 PM

I just did it from one FC6 box to another FC6 box using rsync, should be pretty much the same for your Rehat boxes.

On the target machine, you may want to get into runlevel 3
Also, the target machine will likely have a different nic and hostname so I excluded the /etc/sysconfig folder.

For example:
Code:

# without excluding /etc/sysconfig
rsync -xav --delete-after / root@mudd:/

# this one shows use of exclude
rsync -xav --exclude='/etc/sysconfig' --delete-after / root@mudd:/


hurt138 01-04-2007 01:31 AM

Thanks for the reply's,

And actually it wont have a different hostname or any other settings, it is to be a cold spare server in case the orig one dies for any reason. I have used rsync for archiving backups a fair bit, but in this case because of who this is for they are a little sticky about installing anything extra (even if it is in the package list). I am guessing they will not have rsync installed but because I have used it and the community has suggested it I will lean on them some perhaps. :)

I really wish they had just use RAID for the drives so I could swap one out and just use it to rebuild to boxes..

shawnbishop 01-04-2007 06:11 AM

Hi

Use rsync like above to "mirror" the server, I use to keep mirror backups of my SAMBA servers, should the one fail (as has happened) it just change the IP address of the "mirror" server ...and off you go

BittaBrotha 01-04-2007 06:22 AM

Take a look at SystemRescue and Partimage, is a Ghost/Drive-image clone for Linux.

http://www.sysresccd.org

homey 01-04-2007 06:29 AM

Quote:

Take a look at SystemRescue and Partimage, is a Ghost/Drive-image clone for Linux.
While I am a fan of SystemRescue and Partimage, the OP stated that
Quote:

The catch to this is that the system I need to get the info from can't be taken down for any reason
That rules out both livecd and partimage in this case.

hurt138 01-05-2007 12:10 AM

Anyone had any luck with mondorescue? http://www.mondorescue.org

From the looks of things it is a installed app and does not need to shutdown any services to complete the task.

jlinkels 01-05-2007 02:41 AM

Hurt,

I did this once on a running server. I started up the new one with Knoppix, tarred the original disks, ftp-ed them over, created an mbr, and the new one was running.

(Except for some NIC issues, but that is another story and not related to the cloning)

Oh, and I did that when the machines were both located 5000 miles away from where I was :) I just had someone down at the machines to lay in and remove the Knoppix CD and to start sshd.

jlinkels


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