rmirror - An LCFG component for offline disc mirroring.
This object carries out offline mirroring by invoking rsync.
The run method will normally trigger a mirror of all the sources defined in the disklist resource. However you can specifiy individual tag(s) from that list to cause a mirror of only that source(s). You can also specify the b<-f> flag to force a mirror. eg
om rmirror run -- -f jings
Outputs a report of the state of the mirrors.
-m output a machine readable version of the report
-n report clients that in the spanning map, but don't appear to be configured to be mirrored. Note that just because this server isn't mirroring a client, doesn't mean another server isn't. Also -m also implies -n.
-a report from all mirror servers within the same cluster, useful with -n or -m. Assumes that remctld and kerberos keytabs components are suitably configured.
Example
om rmirror report -- -a -n
A list of disks (tags) to be rsynced to the local machine. The word "disks" is a bit misleading, it's really a list of tags that can happen to be the same name as the rsync targets.
Using this resource it is possible to specify an rsync target name that is different from tag. If it is not set, then it default to tag for backward compatibility with schema 2 version of the component.
The host serving the disk tag. The source disk is expected to be accessible to rsync as srchost::srctag, so there should be an rsync server daemon running on the source machine, offering the source disk as rsync module tag. This can be set up using the rsync LCFG component.
The local destination directory holding the mirror for disk tag.
When set to true rmirror tells rsync to use the --checksum option. When rsync is deciding which files need to be transferred to bring the mirror up to date, this makes rsync checksum all files before transfer, and transfer any files whose checksum and/or size does not match that of the corresponding file already on the rmirror. This option effectively makes rmirror more meticulous when checking for file corruption.
When set to false checksum-checking will not be used on files whose mirror has the same timestamp and size.
The default value is false.
When set to true this option overrides the current setting of the checksum resource for disk tag only. Its default value is the same as for the checksum resource.
Rmirror normally does a "dry run" of its rsync command to calculate how much of the mirror's current contents it would delete, before going ahead with the mirroring operation (see the description of the safetylimit option below). The rsync command used to perform this dry run is usually identical to the "real" rsync command but with the addition of the rsync --dry-run option. However when inhibitsafetychecksum is set to true rmirror will not use the --checksum option during the rsync dry run. (Of course, if checksum is not set to true, rsync's --checksum option will not be used at all anyway.) Using inhibitsafetychecksum can significantly reduce the time taken to mirror a large collection of files when checksum is set to true, at the expense of getting a less accurate estimate of the number of files to be deleted in cases where files on the mirror have become corrupted (for example by filesystem damage).
The default value is false.
When set to true this option overrides the current setting of the inhibitsafetychecksum resource for disk tag only. Its default value is the same as for the checksum resource.
When set to true, rsync will not copy any files whose existing mirror copies are already the same length and have the same timestamp.
When set to false rmirror tells rsync to use the --ignore-times option, which makes rsync ignore timestamps when deciding which files to copy.
The default value is true.
When set to true this option overrides the current setting of the timestamp resource for disk tag only. Its default value is the same as for the timestamp resource.
When set to true this option tells rsync to use its --whole-file option. This makes rsync copy across whole files which have changed, rather than using its incremental algorithm to copy across only the changes.
When set to false rsync will use its default behaviour, which is to use its incremental algorithm - that is, copying across only the parts of files which have changed - unless both source and target are on the local machine. This option will often result in quicker running of rmirror, but may lead to any temporary corruption of a file on the source machine persisting indefinitely in the target machine's copy of the file.
The default value is false.
When set to true this option overrides the current setting of the wholefiles resource for disk tag only. Its default value is the same as for the wholefiles resource.
When set to true this option makes rmirror tell rsync to use its --delete-after option. This makes rsync delete outdated files on the target system after copying across changes from the source system.
When set to false this option makes rmirror tell rsync to use its default file deletion behaviour, which is to delete outdated files on the target system before copying across changes from the source system.
The default value is false.
When set to true this option overrides the current setting of the deleteafter resource for disk tag only. Its default value is the same as for the deleteafter resource.
This resource is the time, in seconds, before rmirror gives up on an apparently dormant rsync process on a remote machine, times it out, and goes on to the next backup to be performed. The timeout option sets the timeout value for all rmirror backups on this machine. The default value is 3600, meaning one hour. To disable timeouts set this option to 0.
This resource overrides the current setting of the timeout resource for disk tag only. It has the same default value as the timeout resource.
This resource is the maximum percentage of the files in the existing backup copy that it is permissible for an rmirror run to delete. Just before rmirror performs a backup, it calculates what percentage of the files in the existing backup would be deleted by the backup running again; and if this percentage is greater than the maximum allowable percentage in the safetylimit resource, the backup is cancelled and a warning is given. The default value of safetylimit is 10, meaning that a backup will not run if it would mean deleting more than 10% of the existing backup files.
This resource overrides the current setting of the safetylimit resource for disk tag only. It has the same default value as the safetylimit resource.
Full path to script that given a single argument of a file system path, reports true or false if that path is being backed up to tape.
The keytab file to use when using remctl to call the rmirror report service on the other mirrors servers in the cluster.
The servercluster spanning map below needs to export some resource, hostname seemed like it might be useful. It should automatically be populated from profile.node and profile.domain
Specifies the spanning map we are exporting the above hostname to. All mirror servers at the same mirror site should set this resource to the same thing, so they can find each other, eg mirrorservers/jcmb
This is another part of ugly fudge so the mirror servers at the same site can find each other. This specifies the map we want to subscribe to (as we can't publish and subscribe simulatenously). It should be the same value as the servercluster resource, and thus populates the clusterpeers list below.
Is the resource that is automatically populated with the list of mirror servers at the same site, ie all the machines that have their servercluster set to the same value as our clusterpeersmap.
A tagged <ctag> list of rmirror client machines that is populated automatically by subscribing to the clientcluster spanning map below.
A space separated list of the rsync targets on this client machine it would like mirrored.
A corresponding space separately list of whether that target's mirror should also go to tape, only "yes", "no" values are acceptable.
The list of DNS aliases the client may be known by. This is to aid reconcillation in the report.
A text label applied to this client so it's entries can be easily grepped for in the machine readble report output. eg services-unit, mpu.
List of email addresses to mail if there is a problem with the mirror of the ctag client.
The level of mirror status messages should be sent to email_ctag, can be one of: all, warn or error.
The name of the spanning map to subscribe to that populates the clients and associated <ctag>'d resources.
Chris Cooke
Neil Brown