Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cloning Servers

Status
Not open for further replies.

columb

IS-IT--Management
Feb 5, 2004
1,231
EU
OK, so her's the problem. We have a number of servers each built on identical hardware but with slightly different modules etc. For administrative reasons we want them to be totally identical from a Linux perspective. The plan is
[ol]
[li]Build a server to standard RedHat ES4 with all the bits we want (and not those we don't)[/li]
[li]Backup this server using mondoarchive[/li]
[li]On each of the production servers
[ol]
[li]Put a USB Memory stick in the front[/li]
[li]tar up a list of files to this memory stick[/li]
[li]Restore the image built on the test server onto the live chasis[/li]
[li]untar the files back off the memory stick[/li]
[li]reboot and there you are[/li]
[/ol][/li]
[/ol]

The BIG question is exactly which files need to be tarred up. My list so far is
Code:
/etc/hosts
/etc/passwd
/etc/shadow
/etc/group
/etc/cron*
/etc/*.allow
/etc/*.deny

/etc/ssh/*
/etc/sysconfig/*

/home/*
There is another school of thought (my favourite) that it would be best to backup all of /etc except one or two files but no-one can decide which.


So the questions are
[ol]
[li]Should we be trying this at all?[/li]
[li]If so how do we define the file list to back up[/li]
[li]Should our approach be backup all of /etc except selected files or backup selected files.[/li]
[/ol]

An ideas/input gratefully received

Columb Healy
 
Why not just tar up the whole drive and put it on the cloned servers?

We did this years ago as part of a Y2K plan. We also used tar to clone Windows machines (no $ for Ghost or other commercial program).

We had the image on a server and booted from a small Slackware image on floppy to get the machine onto the network.

We imaged about 25 machines in a few hours.



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Sorry - I didn't make myself clear. The problem is not the cloning process per se, it's identifying the files whcih give a server its personality.

The background is that we have a number of servers which were built in a rush for a project. Whereas they ought to be an identical controlled build there are a number of small differences. For a number of reasons we want to standardise the build. I therefore want to replace an existing build with a clone whilst keeping all the bits that make it the server is is. I have no problem with the software it's running, that has clearly defined configuration files and I can back them up and copy them back again. It's linux itself which is causing headaches. For example I know I do want to keep all the inet config files as these are very much part of the individual server. However I do not want to keep the rpm database as that will have changed when the uncontrolled build is replaced by the clone.

Part of me says that the only thing in /etc which I need are the config files, part of me wants to copy back all of /etc except the rpm database (which is not in /etc anyway). Any advice?

Columb Healy
 
Personally I would prefer to select the files that I transferred so that I knew exactly what I had changed, rather than doing "everything except x, y and z".

Annihilannic.
 
Answered my own question

I tarred up /etc on server A, copied it across to Server B and untarred it in /tmp/etc Then
Code:
cd /tmp/etc
for i in $(find . -type d)
do
  diff --brief $i /etc/$i | grep -v "Common subdirectories"
done > /tmp/different_files
The list of files in /tmp/different_files needs editing and some of it can be done by directory rather than file but it makes sure nothing is missed.

Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top