1 #title Monikop (and Pokinom)
2 #subtitle rsync between unconnected hosts
3 #author Bert Burgemeister
9 We assume Debian GNU/Linux here, but any distribution should
10 work. Adapt installation instructions accordingly.
12 Debian Packages needed:
14 - to run Monikop (on Rover) or Pokinom (in office):
15 rsync, mingetty, sudo, libcurses-perl, libfile-rsync-perl;
17 - to install from a git repository: git-core;
19 - to run the tests: bc, time.
21 - Both Monikop and Pokinom run on text console; you don't need
22 anything like Gnome, KDE or even X.
25 ** Prepare Removable Disks
27 Put sticker labels with disk names on your removable disks.
31 Create labelled file systems on the removable disks. Example
32 (suppose a removable disk with a sticker label "=disk_10=" on its case is attached to =/dev/sdg1=):
34 =# mke2fs -j -L disk_10 /dev/sdg1=
36 On both Monikop's and Pokinom's host, label the system root
37 partition. If it were on =/dev/sda1/, that's e.g.=:
39 =# e2label /dev/sda1 root=
41 On both Monikop's and Pokinom's host, label the swap partition. If it
42 happens to be on /dev/sda5, e.g.:
46 =# mkswap -L swap /dev/sda5=
52 On both Monikop's and Pokinom's host, create mount points, one for
55 =# mkdir -p /media/disk_{01,02,03,04...}=
57 =# chmod a+rx /media/disk_{01,02,03,04...}=
60 In =/etc/fstab= on both Monikop's and Pokinom's host, make use of the disk labels:
63 ## System partitions ###
64 LABEL=root / ext3 defaults,errors=remount-ro 0 1
65 LABEL=swap none swap sw 0 0
67 LABEL=disk_01 /media/disk_01 ext3 rw,user,auto 0 0
68 LABEL=disk_02 /media/disk_02 ext3 rw,user,auto 0 0
69 LABEL=disk_03 /media/disk_03 ext3 rw,user,auto 0 0
70 LABEL=disk_04 /media/disk_04 ext3 rw,user,auto 0 0
74 Put each removable disk in and make it writable; e.g.:
76 =# mount /media/disk_01=
78 =# chmod a+rwx /media/disk_01=
80 *** Maintain Bootability
82 On both Monikop's and Pokinom's host, make sure the operating system boots
83 actually from its system disk rather than from some of the removable
84 ones. Change =/boot/grub/menu.lst= where it says <code># kopt=root=...</code>:
87 ### BEGIN AUTOMAGIC KERNELS LIST
88 ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
89 ## by the debian update-grub script except for the default options below
91 ## DO NOT UNCOMMENT THEM, Just edit them to your needs
93 ## ## Start Default Options ##
94 ## default kernel options
95 ## default kernel options for automagic boot options
96 ## If you want special options for specific kernels use kopt_x_y_z
97 ## where x.y.z is kernel version. Minor versions can be omitted.
98 ## e.g. kopt=root=/dev/hda1 ro
99 ## kopt_2_6_8=root=/dev/hdc1 ro
100 ## kopt_2_6_8_2_686=root=/dev/hdc2 ro
101 # kopt=root=/dev/disk/by-label/root noresume ro
109 #Configure_Monikop_and_Pokinom
110 ** Configure Monikop and Pokinom
112 Create a user on both Monikop's and Pokinom's machine. For
113 description's sake, we assume they're called m-operator.
115 Inside m-operator's home directory, [[download][get Monikop (and Pokinom)]];
118 =$ tar -xzf monikop-<version>.tar.gz=
120 =$ mv monikop-<version> monikop=
124 Copy =monikop.config.example= to =monikop.config= and
125 =pokinom.config.example= to =pokinom.config, respectively,= and
126 adapt them according to your needs. Both are perl code, so be careful
127 and keep the punctuation in place.
132 <include file="../monikop.config.example" markup="src" lang="perl">
134 For Monikop, change in [[installation#monikop.config][monikop.config]] at least:
136 - =%sources=: Data producing Sources on Rover in one of the formats Rsync
137 understands, together with a source-specific directory name where data
138 of the respective Source goes. Those directory names can be equal for
139 several Sources as long as all filenames in the payload are certain to be
142 - =@usable_mount_points=: Mount points (directories) you set up [[installation#fstab][earlier]] for your
150 <include file="../pokinom.config.example" markup="src" lang="perl">
152 For Pokinom you should edit in [[installation#pokinom.config][pokinom.config]] at least:
154 - =@usable_mount_points= (as with [[installation#monikop.config][monikop.config]])
155 - =$destination=: Data destination in one of the formats Rsync
156 understands; cf. setup of [[installation#Data_Destination][Data Destination]].
157 - =$rsync_username=, =$rsync_password=: credentials of (and only
158 known to) the Rsync server;
159 cf. setup of [[installation#Data_Destination][Data Destination]].
162 *** Automatic Program Start
165 =/home/m-operator/.profile= (create it if necessary):
168 /home/m-operator/monikop/monikop
174 /home/m-operator/monikop/pokinom,
179 If necessary, specify path to config file, e.g.
181 /home/m-operator/monikop/monikop /home/m-operator/monikop/monikop.config
187 On both Monikop's and Pokinom's host authorise m-operator to shut down computer.
188 Use =visudo= to change =/etc/sudoers=; add:
191 m-operator ALL=(ALL) NOPASSWD: /sbin/halt -p
192 m-operator ALL=(ALL) NOPASSWD: /sbin/reboot
198 On both Monikop's and Pokinom's host, change the line in
199 =/etc/inittab= that looks like
202 1:2345:respawn:/sbin/getty 38400 tty1
208 1:2345:respawn:/sbin/mingetty --autologin m-operator --noclear tty1
212 #Configure_Rsync_on_Sources
213 ** Configure Rsync on Sources
215 Install package rsync.
217 Example for =/etc/rsyncd.conf=:
220 pid file=/var/run/rsyncd.pid
224 lock file = /var/lock/rsyncd
227 transfer logging = false
230 In =/etc/default/rsync=, change the line
244 =# /etc/initd/rsync start=
250 [[http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download][cwRsync]]. Click
251 Start, Programs, cwRsyncServer, rsyncd.conf; edit:
259 # /cygdrive/e/log stands for E:\log
260 path = /cygdrive/e/log
262 transfer logging = false
265 Configure service RsyncServer: right-click My Computer; click Manage, Services
266 and Applications, Services, RsyncServer; set Startup Type to Automatic.
272 Depending on the amount of data to transfer, consider putting a
273 dedicated NIC for each Source into Monikop's machine. In this case,
274 you should provide for non-overlapping subnets. [[http://jodies.de/ipcalc][IP-Calculator]] may be
280 **** Name the Sources
283 Example for =/etc/hosts=:
287 192.168.200.10 data-producer1
288 192.168.200.20 data-producer2
289 192.168.200.30 data-producer3
290 192.168.200.50 data-producer4
291 192.168.178.1 monikop
297 Example for =/etc/network/interfaces=:
299 # The loopback network interface
301 iface lo inet loopback
303 # Net of smaller Sources
305 iface eth1 inet static
306 address 192.168.178.1
307 netmask 255.255.255.0
309 # Dedicated NIC for data-producer1
311 iface eth2 inet static
312 address 192.168.200.9
313 netmask 255.255.255.248
315 # Dedicated NIC for data_producer2
317 iface eth3 inet static
318 address 192.168.200.19
319 netmask 255.255.255.248
321 # Dedicated NIC for data_producer3
323 iface eth4 inet static
324 address 192.168.200.29
325 netmask 255.255.255.248
327 # Dedicated NIC for data_producer4
329 iface eth5 inet static
330 address 192.168.200.49
331 netmask 255.255.255.248
337 Use [[installation#etc_hosts][/etc/hosts]] as with Monikop. For Windows, it's =%SystemRoot%\system32\drivers\etc\hosts=.
342 Example for =/etc/network/interfaces=:
346 iface lo inet loopback
348 # service (not relevant for Monikop)
350 iface eth0 inet static
351 address 192.168.178.2
352 netmask 255.255.255.0
354 # Monikop's dedicated NIC
356 iface eth1 inet static
357 address 192.168.200.10
358 netmask 255.255.255.248
361 For Windows, configure your network settings accordingly.
366 Pokinom's network settings don't need any special treatment. Just
367 integrate it into the office LAN Destination is connected to.
373 *** Rsync Server on Destination
375 Install package rsync.
377 Adapt =/etc/rsyncd.conf=, e.g.:
380 gid = data_receiving_group
383 pid file = /var/run/rsyncd.pid
388 comment = Pokinom only; requires authentication
390 incoming chmod = g+r,g+w,g+x
393 hosts allow = 192.168.180.120
394 auth users = m-operator
395 secrets file = /etc/rsyncd.secrets
398 =/etc/rsyncd.secrets= contains Rsync's credentials which must
399 correspond to settings =$rsync_passwd= and =$rsync_username= in [[installation#pokinom.config][pokinom.config]]:
405 =/etc/rsyncd.secrets= must not be world-readable.
407 In =/etc/default/rsync=, change the line
421 =# /etc/initd/rsync start=
425 With the above, rsync puts the payload it receives into
426 =/mnt/raid_0/NEW_DATA/=. ("=NEW_DATA=" was set with
427 =$destination= in [[installation#pokinom.config][pokinom.config]].)
429 =NEW_DATA/= and everything inside belongs to user
430 nobody and group data_receiving_group.
432 If on Destination you can't do without Windows, install
433 [[http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download][cwRsync]],
434 configure its =rsyncd.conf= accordingly, and set service rsync to
437 ; TODO: net topology for Monikop, for Pokinom