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 install from a git repository: git-core;
16 - to run Monikop (on Rover) or Pokinom (in office):
17 rsync, mingetty, sudo, libcurses-perl, libfile-rsync-perl;
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)]] and
119 Copy =monikop.config.example= to =monikop.config= and
120 =pokinom.config.example= to =pokinom.config, respectively,= and
121 adapt them according to your needs. Both are perl code, so be careful
122 and keep the punctuation in place.
127 <include file="../monikop.config.example" markup="src" lang="perl">
129 For Monikop, change in [[installation#monikop.config][monikop.config]] at least:
131 - =%sources=: Data producing Sources on Rover in one of the formats Rsync
132 understands, together with a source-specific directory name where data
133 of the respective Source goes. Those directory names can be equal for
134 several Sources as long as all filenames in the payload are certain to be
137 - =@usable_mount_points=: Mount points (directories) you set up [[installation#fstab][earlier]] for your
145 <include file="../pokinom.config.example" markup="src" lang="perl">
147 For Pokinom you should edit in [[installation#pokinom.config][pokinom.config]] at least:
149 - =@usable_mount_points= (as with [[installation#monikop.config][monikop.config]])
150 - =$destination=: Data destination in one of the formats Rsync
151 understands; cf. setup of [[installation#Data_Destination][Data Destination]].
152 - =$rsync_username=, =$rsync_password=: credentials of (and only
153 known to) the Rsync server;
154 cf. setup of [[installation#Data_Destination][Data Destination]].
157 *** Automatic Program Start
160 =/home/m-operator/.profile= (create it if necessary):
163 /home/m-operator/monikop/monikop
169 /home/m-operator/monikop/pokinom,
174 If necessary, specify path to config file, e.g.
176 /home/m-operator/monikop/monikop /home/m-operator/monikop/monikop.config
182 On both Monikop's and Pokinom's host authorise m-operator to shut down computer.
183 Use =visudo= to change =/etc/sudoers=; add:
186 m-operator ALL=(ALL) NOPASSWD: /sbin/halt -p
187 m-operator ALL=(ALL) NOPASSWD: /sbin/reboot
193 On both Monikop's and Pokinom's host, change the line in
194 =/etc/inittab= that looks like
197 1:2345:respawn:/sbin/getty 38400 tty1
203 1:2345:respawn:/sbin/mingetty --autologin m-operator --noclear tty1
207 #Configure_Rsync_on_Sources
208 ** Configure Rsync on Sources
210 Install package rsync.
212 Example for =/etc/rsyncd.conf=:
215 pid file=/var/run/rsyncd.pid
219 lock file = /var/lock/rsyncd
222 transfer logging = false
225 In =/etc/default/rsync=, change the line
239 =# /etc/initd/rsync start=
245 [[http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download][cwRsync]]. Click
246 Start, Programs, cwRsyncServer, rsyncd.conf; edit:
254 # /cygdrive/e/log stands for E:\log
255 path = /cygdrive/e/log
257 transfer logging = false
260 Configure service RsyncServer: right-click My Computer; click Manage, Services
261 and Applications, Services, RsyncServer; set Startup Type to Automatic.
267 Depending on the amount of data to transfer, consider putting a
268 dedicated NIC for each Source into Monikop's machine. In this case,
269 you should provide for non-overlapping subnets. [[http://jodies.de/ipcalc][IP-Calculator]] may be
275 **** Name the Sources
278 Example for =/etc/hosts=:
282 192.168.200.10 data-producer1
283 192.168.200.20 data-producer2
284 192.168.200.30 data-producer3
285 192.168.200.50 data-producer4
286 192.168.178.1 monikop
292 Example for =/etc/network/interfaces=:
294 # The loopback network interface
296 iface lo inet loopback
298 # Net of smaller Sources
300 iface eth1 inet static
301 address 192.168.178.1
302 netmask 255.255.255.0
304 # Dedicated NIC for data-producer1
306 iface eth2 inet static
307 address 192.168.200.9
308 netmask 255.255.255.248
310 # Dedicated NIC for data_producer2
312 iface eth3 inet static
313 address 192.168.200.19
314 netmask 255.255.255.248
316 # Dedicated NIC for data_producer3
318 iface eth4 inet static
319 address 192.168.200.29
320 netmask 255.255.255.248
322 # Dedicated NIC for data_producer4
324 iface eth5 inet static
325 address 192.168.200.49
326 netmask 255.255.255.248
332 Use [[installation#etc_hosts][/etc/hosts]] as with Monikop. For Windows, it's =%SystemRoot%\system32\drivers\etc\hosts=.
337 Example for =/etc/network/interfaces=:
341 iface lo inet loopback
343 # service (not relevant for Monikop)
345 iface eth0 inet static
346 address 192.168.178.2
347 netmask 255.255.255.0
349 # Monikop's dedicated NIC
351 iface eth1 inet static
352 address 192.168.200.10
353 netmask 255.255.255.248
356 For Windows, configure your network settings accordingly.
361 Pokinom's network settings don't need any special treatment. Just
362 integrate it into the office LAN Destination is connected to.
368 *** Rsync Server on Destination
370 Install package rsync.
372 Adapt =/etc/rsyncd.conf=, e.g.:
375 gid = data_receiving_group
378 pid file = /var/run/rsyncd.pid
383 comment = Pokinom only; requires authentication
385 incoming chmod = g+r,g+w
388 hosts allow = 192.168.180.120
389 auth users = m-operator
390 secrets file = /etc/rsyncd.secrets
393 =/etc/rsyncd.secrets= contains Rsync's credentials which must
394 correspond to settings =$rsync_passwd= and =$rsync_username= in [[installation#pokinom.config][pokinom.config]]:
400 =/etc/rsyncd.secrets= must not be world-readable.
402 In =/etc/default/rsync=, change the line
416 =# /etc/initd/rsync start=
420 With the above, rsync puts the payload it receives into
421 =/mnt/raid_0/NEW_DATA/=. ("=NEW_DATA=" was set with
422 =$destination= in [[installation#pokinom.config][pokinom.config]].)
424 =NEW_DATA/= and everything inside belongs to user
425 nobody and group data_receiving_group.
427 If on Destination you can't do without Windows, install
428 [[http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download][cwRsync]],
429 configure its =rsyncd.conf= accordingly, and set service rsync to
432 ; TODO: net topology for Monikop, for Pokinom