From 59259aca4de7fc10363d70fa2c2e2f9767d90829 Mon Sep 17 00:00:00 2001 From: Bert Burgemeister Date: Fri, 15 Jan 2010 18:34:24 +0100 Subject: [PATCH] More documentation. --- doc/monikop.muse | 480 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 276 insertions(+), 204 deletions(-) diff --git a/doc/monikop.muse b/doc/monikop.muse index fe4f7c9..4e282a5 100644 --- a/doc/monikop.muse +++ b/doc/monikop.muse @@ -1,5 +1,5 @@ -#title Monikop -#subtitle Some Subtitelish Text +#title Monikop and Pokinom +#subtitle rsync from unconnected hosts * Purpose @@ -27,29 +27,48 @@ need to have rsync servers installed. * Installation -Debian packages to use +** Packages + +For Debian, use - to install from a git repository: git-core; - - to run Monikop and Pokinom: + - to run Monikop or Pokinom: rsync, mingetty, sudo, libcurses-perl, libfile-rsync-perl, mingetty; - to run the tests: bc, time. -Prepare removable disks and their mount points: +** Prepare Removable Disks + +*** File Systems -Create Filesystems with labels. Example (suppose disk tagged =disk_10= is attached to =/dev/sdg1=): +Create Filesystems with labels for the removable disks. Example +(suppose a removable disk tagged =disk_10= is attached to =/dev/sdg1=): =mke2fs -j -L disk_10 /dev/sdg1= -Label the swap partition: +Label the system partition. If it were on =/dev/sda1/=: + +=e2label /dev/sda1 root= + +Label the swap partition. If it happens to be on /dev/sda5: =swapoff= -TODO + +=mkswap -L swap /dev/sda5= + =swapon= +*** Mount Points + +Create mount points, one for each removable disk: + +=mkdir -p /media/disk_{01,02,03}= etc. + +=chmod a+rx /media/disk_{01,02,03}= etc. + In =/etc/fstab=, make use of the disk labels: @@ -59,12 +78,22 @@ LABEL=swap none swap sw 0 0 ## Removable disks LABEL=disk_01 /media/disk_01 ext3 rw,user,auto 0 0 LABEL=disk_02 /media/disk_02 ext3 rw,user,auto 0 0 -# etc +LABEL=disk_03 /media/disk_03 ext3 rw,user,auto 0 0 +# etc. + +Put each removable disk in and make it writable: + +=mount /media/disk_01= + +=chmod a+rwx /media/disk_01= -Make sure system boots actually from the system disk rather than from -some of the removable ones. Change =/boot/grub/menu.lst= where is says -# kopt=root=...: +** Maintain Bootability + +Make sure the system boots actually from its system disk rather than from +some of the removable ones. Change =/boot/grub/menu.lst= where it says + +# kopt=root=...: ### BEGIN AUTOMAGIC KERNELS LIST @@ -88,8 +117,26 @@ and call =update-grub= + +** Automatic Login + +=/etc/inittab=: change line which says + + +1:2345:respawn:/sbin/getty 38400 tty1 + + +into + + +1:2345:respawn:/sbin/mingetty --autologin m-operator --noclear tty1 + + + +** Install Monikop and Pokinom + Create a user on both Monikop's and Pokinom's machine. For -descriptions sake, we assume they're called m-operator. +description's sake, we assume they're called m-operator. Get Monikop (and Pokinom); from m-operator's home directory say: @@ -126,13 +173,13 @@ Things you want to change for Monikop in =monikop.config=: =%sources= are the data producing Sources in a format rsync understands, together with a source-specific directory name where data of the respective Source goes. Those directory names can be equal for -several Sources if all filenames are certain to be unique. +several Sources if all filenames in the payload are certain to be +unique. -=@usable_mount_points= are mount points (directories) for your -removable disks. Every disk needs its own mountpoint whose name should -correspond to the disk's label. +=@usable_mount_points= are mount points (directories) you set up for your +removable disks. -Things you want to change for Pokinom in =pokinom.config=: +Things you want to change accordingly for Pokinom in =pokinom.config=: # Possible mount points. @@ -143,212 +190,237 @@ Things you want to change for Pokinom in =pokinom.config=: ); +*** Autostart -** Automatic login (Monikop and Pokinom): +Append to =~/.profile= (create if necessary): -=/etc/inittab=: change line which says + +/home/m-operator/monikop/monikop + + +or + + +/home/m-operator/monikop/pokinom, +respectively. + + +If necessary, specify path to config file, e.g. + +/home/m-operator/monikop/monikop /home/m-operator/monikop/monikop.config + + + +*** Setup Sudo + +Authorize m-operator to shut down computer. +Use =visudo= to change =/etc/sudoers=; add: -1:2345:respawn:/sbin/getty 38400 tty1 +messung ALL=(ALL) NOPASSWD: /sbin/halt -p +messung ALL=(ALL) NOPASSWD: /sbin/reboot -into + + +** Configure Rsync on Sources + +Install package rsync. + +Example for =/etc/rsyncd.conf=: -1:2345:respawn:/sbin/mingetty --autologin m-operator --noclear tty1 +pid file=/var/run/rsyncd.pid +[data] + path = /mnt/hdd_0 + use chroot = false + lock file = /var/lock/rsyncd + read only = yes + list = yes + transfer logging = false -** Autostart (Monikop and Pokinom): - Append to =~/.profile= (create if necessary): - - /home/m-operator/monikop/monikop - - or - - /home/m-operator/monikop/pokinom, - respectively. - +In =/etc/default/rsync=, change a line from - If necessary, specify path to config file, e.g. - - /home/m-operator/monikop/monikop /home/m-operator/monikop/monikop.config - + +RSYNC_ENABLE = false + +to -** Authorize m-operator to shut down computer + +RSYNC_ENABLE = true + -Use =visudo= to change =/etc/sudoers=; add: +Start rsync server: + +=/etc/initd/rsync start= + +or reboot. + + +On Windows, install +[[http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download][cwRsync]]. Click +Start, Programs, cwRsyncServer, rsyncd.conf; edit: + + +use chroot = false +strict modes = false +hosts allow = * +logfile = rsyncd.log +[data] +# /cygdrive/e/log stands for E:\log + path = /cygdrive/e/log + read only = false + transfer logging = false + + +Configure service rsync for automatic start. - - messung ALL=(ALL) NOPASSWD: /sbin/halt -p - messung ALL=(ALL) NOPASSWD: /sbin/reboot - ** Network setup +Depending on the amount of data to transfer, consider putting a dedicated NIC for each Source into Monikop's machine. +In this case, you should provide for non-overlapping +subnets. [[http://jodies.de/ipcalc][IP-Calculator]] may be helpful. + *** Monikop - - =/etc/hosts= - - 127.0.0.1 localhost - 192.168.200.10 central - 192.168.178.20 nav - 192.168.200.30 front - 192.168.178.40 data - 192.168.200.50 rear-left - 192.168.200.60 rear-right - 192.168.200.70 scanner - - - - =/etc/network/interfaces= - - # The loopback network interface - auto lo - iface lo inet loopback - - # central - allow-hotplug eth1 - iface eth1 inet static - address 192.168.200.9 - netmask 255.255.255.248 - - # switch - allow-hotplug eth2 - iface eth2 inet static - address 192.168.178.40 - netmask 255.255.240.0 - gateway 192.168.180.169 - - # front - allow-hotplug eth3 - iface eth3 inet static - address 192.168.200.29 - netmask 255.255.255.248 - - # rear-left - allow-hotplug eth4 - iface eth4 inet static - address 192.168.200.49 - netmask 255.255.255.248 - - # rear-right - allow-hotplug eth5 - iface eth5 inet static - address 192.168.200.59 - netmask 255.255.255.248 - - # scanner - allow-hotplug eth6 - iface eth6 inet static - address 192.168.200.69 - netmask 255.255.255.248 - - - - Provide for non-overlapping subnets. (http://jodies.de/ipcalc may be helpful.) - -*** Data sources - - - Windows: Location of =/etc/hosts/=: =%SystemRoot%\system32\drivers\etc\hosts= - - - IP address 192.168.200.60 - - Subnet mask 255.255.255.248 - - - =/etc/hosts=: - - - 127.0.0.1 localhost - 192.168.178.10 central - 192.168.178.20 nav - 192.168.178.30 front - 192.168.178.40 data - 192.168.178.50 rear-left - 192.168.178.60 rear-right - 192.168.178.70 scanner - - - - =rsyncd.conf=: - - (click Start, Programs, csRsyncServer, rsyncd.conf) - - use chroot = false - strict modes = false - hosts allow = * - logfile = rsyncd.log - [log] - # /cygdrive/e/log stands for E:\log - path = /cygdrive/e/log - read only = false - transfer logging = false - - - pid file=/var/run/rsyncd.pid - [log] - path = /media/platte_03 - use chroot = yes - lock file = /var/lock/rsyncd - read only = yes - list = yes - uid = nobody - gid = nogroup - strict modes = yes - ignore errors = no - ignore nonreadable = yes - transfer logging = no - - -*** Pokinom -*** fsck-pokinom -*** Data destination - -** Rsync server installation - - - Linux - - =/etc/default/rsync=: - Change line from - - RSYNC_ENABLE = false - - to - - RSYNC_ENABLE = true - - =/etc/rsyncd.conf:= - - - gid = str_db1_media - use chroot = yes - max connections = 0 - pid file = /var/run/rsyncd.pid - - [media] - path = /mnt/./data0 - list = no - comment = Pokinom only (requires authentication) - read only = no - incoming chmod = g+r,g+w - write only = yes - # Pokinom's IP: - hosts allow = 192.168.180.120 - auth users = m-operator - secrets file = /etc/rsyncd.secrets - - - =/etc/rsyncd.secrets=: - - - m-operator:seCreT - - - Data source (rover) - Data destination (office) - - - Windows - - install cwrsync: - http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download - rsyncd.conf - Service rsync: autostart + +**** Name the Sources + +Example for =/etc/hosts=: + + +127.0.0.1 localhost +192.168.200.10 data-producer1 +192.168.200.20 data-producer2 +192.168.200.30 data-producer3 +192.168.200.50 data-producer4 +192.168.178.1 monikop + + + +**** Configure NICs + +Example for =/etc/network/interfaces=: + +# The loopback network interface +auto lo +iface lo inet loopback + +# Net of smaller Sources +allow-hotplug eth1 +iface eth1 inet static + address 192.168.178.1 + netmask 255.255.255.0 + +# Dedicated NIC for data-producer1 +allow-hotplug eth2 +iface eth2 inet static + address 192.168.200.9 + netmask 255.255.255.248 + +# Dedicated NIC for data_producer2 +allow-hotplug eth3 +iface eth3 inet static + address 192.168.200.19 + netmask 255.255.255.248 + +# Dedicated NIC for data_producer3 +allow-hotplug eth4 +iface eth4 inet static + address 192.168.200.29 + netmask 255.255.255.248 + +# Dedicated NIC for data_producer4 +allow-hotplug eth5 +iface eth5 inet static + address 192.168.200.49 + netmask 255.255.255.248 + + + +*** Data Sources + + +Use =/etc/hosts= as for Monikop. For Windows, it's =%SystemRoot%\system32\drivers\etc\hosts=. + +**** Source's NIC + +Example for =/etc/network/interfaces=: + + +auto lo +iface lo inet loopback + +# service (not relevant for Monikop) +allow-hotplug eth0 +iface eth0 inet static + address 192.168.178.2 + netmask 255.255.255.0 + +# Monikop's dedicated NIC +allow-hotplug eth1 +iface eth1 inet static + address 192.168.200.10 + netmask 255.255.255.248 + + +For Windows, configure your network settings accordingly. + + +** Pokinom +** fsck-pokinom +** Data destination + ++** Rsync server installation + +- Linux + +=/etc/default/rsync=: +Change line from + +RSYNC_ENABLE = false + +to + +RSYNC_ENABLE = true + +=/etc/rsyncd.conf:= + + + gid = str_db1_media + use chroot = yes + max connections = 0 + pid file = /var/run/rsyncd.pid + + [media] + path = /mnt/./data0 + list = no + comment = Pokinom only (requires authentication) + read only = no + incoming chmod = g+r,g+w + write only = yes + # Pokinom's IP: + hosts allow = 192.168.180.120 + auth users = m-operator + secrets file = /etc/rsyncd.secrets + + +=/etc/rsyncd.secrets=: + + +m-operator:seCreT + + + +- Windows + +install cwrsync: +http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download +rsyncd.conf +Service rsync: autostart * Usage -- 2.11.4.GIT