7

I have a couple of Debian servers with only little users and services. The applications are kept as far as possible in their own directories where they can be backed-up or synced easily.

But I have trouble to find an easy and reliable way to back up the surrounding data and to easily to reapply it to new servers in case of upgrade/failovers etc. By surrounding data, I am referring to files in /etc, some dot-files in ~HOME or the crontab entries.

How would you improve the following strategy, when switching a server:

  1. Copy /etc/passwd, /etc/group and /etc/shadow from other server too keep numerical ids consistent
  2. Copy the whole /home directory and /root directory across
  3. Manually copy the the application settings in /etc (eg. /etc/apache2, /etc/php, /etc/proftpd... and their entries in /etc/default/tomcat6
  4. Install the programs via apt.

There are no human users, so no deed to keep contents of home directories synced. Its all about things like .ssh keys etc.

Martin
  • 316
  • 2
  • 13

1 Answers1

10

Any proper answer is going to more or less boil down to this:

  1. Keep configs in a config management system. These can also handle package installation and upgrades. (Puppet, Chef, etc.)
  2. Use some sort of centralized database for user and group information. (LDAP, Kerberos, NIS, etc.)
  3. Use shared storage for /home. (NFS is the most frequently-used method here)
EEAA
  • 108,414
  • 18
  • 172
  • 242
  • Thank you for this answer. I am looking at the configuration systems currently, and I agree that your answer is probably that best solution for my question. Still it seems to me, that I am just pushing the problem to another layer. To use a config system, I have to install it and a user for it, make sure that it does not mess interfere with existing numerical ids I use across servers, store an shh key or other means of authentication... But basically this is not that much more than I needed before. – Martin Nov 20 '12 at 07:58
  • This should be a comment to EEAA's answer. Instead of a user database, for simple use, i'd try webmin. It can sync users/groups/packages between servers just fine. Unfortunately, it can do nothing about config files, unless you want to make scheduled file copying. – Squall5668 Nov 20 '12 at 05:57
  • Sorry, I can't get behind any use of Webmin, nor any other GUI control panel. – EEAA Nov 20 '12 at 06:25
  • 1
    @Martin - The difference with config management systems is that they **scale**. Configuration values that are common to all or many of your systems become very simple to change - just update it in one place and it automatically gets applied to all systems. Additionally, with a config management system, you can keep your configuration in version control. – EEAA Nov 20 '12 at 15:48
  • @EEAA Yes, the version control is probably the best thing about it. I have decdided to try cdist, it seems to be the most lightweight software i found. – Martin Nov 21 '12 at 02:04