next up previous contents
Next: Doing more with Replicator Up: Replicator 2.0.1 for Debian/GNU Previous: Introduction   Contents

Subsections

Using Replicator

The computer you want to replicate is called your model. All along this documentation we refer to a computer called miniroot-server. For basic use of replicator, miniroot-server IS THE SAME than model. This computer is the one where you want to install replicator.

Installing Replicator (warning)

It's a standard Debian package :-). Just use dpkg or apt.

Warning: The kernel running on the computer where you will create the bootdisk (see 4.5.1) must support loop device. Standard kernels shipped with Debian are ok.

Upgrading from 1.X

If you are upgrading from version 1.X, I strongly suggest that you create a new miniroot using repli-miniroot. You should also check carefully the new /usr/share/doc/replicator/replicator.conf.example.

Configuration of replicator.conf

Edit the file /etc/replicator/replicator.conf (it is heavily commented). Change the value of the perl variables to fit your needs.

The following sections are presented here in the order they are used during the replication.

the general section

the miniroot section


the bootdisk section

the target network section

the target partitioning section


the update rules section

Nothing but a reminder. To fine tune the list of files/directories which are replicated, edit /etc/replicator/update_rules. If you delete this file, the default rules are in /usr/lib/replicator/update_rules.default. In this files are defined 3 variables:

This is how replicator proceeds:

To define an empty update rule use the syntax: @usr_exclude=qw("");

the miscellaneous section

Site preparation for the replication


Compiling a boot kernel for the installation floppy

Compile a kernel with all the necessary driver for the computer target. Do not use modules for the drivers required at boot time (typically network and SCSI).

Add the following option during configuration of the kernel:

Compile this kernel with classical make dep ; make bzImage (don't use make-kpkg). This kernel will be use to boot the computer target. Put this new kernel in a safe place.

Preparing the miniroot

As root execute repli-miniroot. You need acces to a Debian potato mirror. It can be a CD set, a remote mirror somewhere on the network or a local mirror.

This will create a special filesystem (e.g. /export/install/miniroot) whith a basical Debian/GNU Linux on it.

VERY IMPORTANT: Each time you modify the configuration in /etc/replicator/ you must run the command:

repli-miniroot -update-config
or
repli-miniroot -u

Don't forget to export miniroot-dir for target with the no_root_squash option. To do that, edit /etc/export and add a line like:

/export/install/miniroot target.my.domain(rw,no_root_squash)

Then tell the nfs-server to reload it's configuration:

/etc/init.d/nfs-server reload

Warning: Every line of /etc/export file must end with a newline character otherwise you will get silly error messages at boot time.

Authorizing targets to access model with rsyncd

Replicator comes with a /etc/replicator/rsyncd.conf file:

#
#this is rsyncd.conf for replicator
#
[replicator]
path=/
use chroot=no
read only=yes
uid=0
#max connections = 20
#
#in case you don't use tcpwrapper (bad:)
hosts allow=192.168.0.0/255.255.0.0
hosts deny=*

You are responsible for launching rsyncd on the model with this config files. That means either moving this file to /etc/rscynd.conf or editing your existing /etc/rscynd.conf to add the rsync module [replicator] as defined into /etc/replicator/rsyncd.conf.

You can either :

Don't forget to change the hosts allow and hosts deny settings.

Preparing the custom post-replication script

You can create a shell script /etc/replicator/repli-postint. It will be executed at the very end of the copying process. It is your postint script. Again run repli-miniroot -update-config to copy this file to the miniroot.

Note: This script is run chrooted in the root filesystem of target (exactly as it would run after rebooting).

Here are some suggestions of what can you put in this script:

Installing the target


Creation of the boot floppy

Use the script repli-bootdisk.

You can put a floppy right now in your floppy drive. If you interrupt repli-bootdisk with ctrl-C you can copy by hand the file /tmp/name-of-the-target.img on a floppy with the command cp.

Using the boot floppy

  1. sit down on front of the target computer,
  2. insert the floppy,
  3. turn the power on,
  4. login as root with the password you set at the creation of the miniroot,
  5. answer the 4 questions,
  6. If you choose the manual installation, launch the following scripts yourself. You must add the -real option to make the scripts actually do something.
    1. repli-install hdsetup (-real)
    2. repli-install hostconf (-real)
    3. repli-install netcopy (-real)
    4. repli-install configure(-real)
    5. repli-postint
  7. remove the floppy,
  8. reboot.


The light classes mechanism (aka the strategy guide)

This is very important and usefull. One easy way to define replication classes is to create specific configuration files.

To summarize:

The following examples should help you understand how replicator deals with its configurations files.

Installing computers in more than one network

Starting with version 2.0.1 of replicator, you only need to fill the variable @networks and the corresponding lists of targets in replicator.conf. See 4.3.3.

Installing a special computer among a set of identical others

Lets suppose you are installing a classrom: all computers are identical (call them student1, student2, ...) except the teacher's one (just call it teacher).

For example, students'computers, have a 1GB harddisk with /home nfs-mounted and boot vith dhcp, whereas teacher has hardcoded network configuration, one 4GB disk for the OS and a second ide disk with local /home in /dev/hdb1.

In such a case we use /etc/replicator/replicator.conf to put defaults for the identical computers and we make a file /etc/replicator/replicator.conf_teacher for the unique computer teacher.

In /etc/replicator/replicator.conf :

@autopart_specs =
#mount point            min_size        max_size 
  ([ "/" ,              "100Mo",        "1000Mo"],
   [ "swap",            "64Mo",         "128Mo"],
  );

$fstab_supp = "/dev/fd0 /floppy auto defaults,user,noauto 0 0
homeserver:/exports/home /home nfs rw,defaults,rsize=8192,wsize=8192 0 0
/dev/cdrom /cdrom auto ro,defaults,user,noauto 0 0\n";

In file /etc/replicator/replicator.conf_teacher:

@targets=qw(teacher);

$domainname = 'classroom.here';
$gateway = '192.168.32.23'; 
$netmask='255.255.255.0';
$network='192.168.32.0';
$broadcast='192.168.32.255';

#mount point            min_size        max_size 
  ([ "/" ,              "100Mo",        "400Mo"],
   [ "swap",            "64Mo",         "128Mo"],
   [ "/usr" ,           "800Mo",      "3000Mo" ],
   [ "/var" ,           "200Mo",      "1000Mo" ],
  );

$fstab_supp = "/dev/fd0 /floppy auto defaults,user,noauto 0 0
/dev/hdb1 /home auto defaults 0 0
/dev/cdrom /cdrom auto ro,defaults,user,noauto 0 0\n";

Now create the bootisk with :

repli-bootdisk -config /etc/replicator/replicator.conf_teacher

To install a student computer, boot it with the bootdusk and chosse `` Boot with DHCP and Install a DHCP target'' in grub's menu. To install teacher, use the same bootdisk and choose ``Boot Teacher ...'' in grub's menu.


next up previous contents
Next: Doing more with Replicator Up: Replicator 2.0.1 for Debian/GNU Previous: Introduction   Contents
root 2001-06-04