1 #title Monikop and Pokinom
2 #subtitle rsync between unconnected hosts
8 We assume Debian GNU/Linux here, but any distribution should
9 work. Adapt installation instructions accordingly.
11 Debian Packages needed:
13 - to install from a git repository: git-core;
15 - to run Monikop (on Rover) or Pokinom (in office):
16 rsync, mingetty, sudo, libcurses-perl, libfile-rsync-perl;
18 - to run the tests: bc, time.
20 - Both Monikop and Pokinom run on text console; you don't need
21 anything like Gnome, KDE or even X.
24 ** Prepare Removable Disks
26 Put sticker labels with disk names on your removable disks.
30 Create labelled filesystems on the removable disks. Example
31 (suppose a removable with a sticker label "=disk_10=" on its case is attached to =/dev/sdg1=):
33 =# mke2fs -j -L disk_10 /dev/sdg1=
35 On both Monikop's and Pokinom's host, label the system root
36 partition. If it were on =/dev/sda1/, that's e.g.=:
38 =# e2label /dev/sda1 root=
40 On both Monikop's and Pokinom's host, label the swap partition. If it
41 happens to be on /dev/sda5, e.g.:
45 =# mkswap -L swap /dev/sda5=
51 On both Monikop's and Pokinom's host, create mount points, one for
54 =# mkdir -p /media/disk_{01,02,03,04...}=
56 =# chmod a+rx /media/disk_{01,02,03,04...}=
59 In =/etc/fstab= on both Monikop's and Pokinom's host, make use of the disk labels:
62 ## System partitions ###
63 LABEL=root / ext3 defaults,errors=remount-ro 0 1
64 LABEL=swap none swap sw 0 0
66 LABEL=disk_01 /media/disk_01 ext3 rw,user,auto 0 0
67 LABEL=disk_02 /media/disk_02 ext3 rw,user,auto 0 0
68 LABEL=disk_03 /media/disk_03 ext3 rw,user,auto 0 0
69 LABEL=disk_04 /media/disk_04 ext3 rw,user,auto 0 0
73 Put each removable disk in and make it writable; e.g.:
75 =# mount /media/disk_01=
77 =# chmod a+rwx /media/disk_01=
79 *** Maintain Bootability
81 On both Monikop's and Pokinoms host, make sure the operating system boots
82 actually from its system disk rather than from some of the removable
83 ones. Change =/boot/grub/menu.lst= where it says <code># kopt=root=...</code>:
86 ### BEGIN AUTOMAGIC KERNELS LIST
87 ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
88 ## by the debian update-grub script except for the default options below
90 ## DO NOT UNCOMMENT THEM, Just edit them to your needs
92 ## ## Start Default Options ##
93 ## default kernel options
94 ## default kernel options for automagic boot options
95 ## If you want special options for specific kernels use kopt_x_y_z
96 ## where x.y.z is kernel version. Minor versions can be omitted.
97 ## e.g. kopt=root=/dev/hda1 ro
98 ## kopt_2_6_8=root=/dev/hdc1 ro
99 ## kopt_2_6_8_2_686=root=/dev/hdc2 ro
100 # kopt=root=/dev/disk/by-label/root noresume ro
108 #Configure_Monikop_and_Pokinom
109 ** Configure Monikop and Pokinom
111 Create a user on both Monikop's and Pokinom's machine. For
112 description's sake, we assume they're called m-operator.
114 Get Monikop (and Pokinom); from m-operator's home directory say:
116 =$ git-clone (FIXME: repo here)=
118 Copy =monikop.config.example= to =monikop.config= and
119 =pokinom.config.example= to =pokinom.config, respectively,= and
120 adapt them according to your needs. Both are perl code, so be careful
121 and keep the interpunction in place.
126 <include file="../monikop.config.example" markup="src" lang="perl">
128 For Monikop, change in [[installation#monikop.config][monikop.config]] at least:
130 - =%sources=: Data producing Sources on Rover in one of the formats Rsync
131 understands, together with a source-specific directory name where data
132 of the respective Source goes. Those directory names can be equal for
133 several Sources as long as all filenames in the payload are certain to be
136 - =@usable_mount_points=: Mount points (directories) you set up [[installation#fstab][earlier]] for your
144 <include file="../pokinom.config.example" markup="src" lang="perl">
146 For Pokinom you should edit in [[installation#pokinom.config][pokinom.config]] at least:
148 - =@usable_mount_points= (as with [[installation#monikop.config][monikop.config]])
149 - =$destination=: Data destination in one of the formats Rsync
150 understands; cf. setup of [[installation#Data_Destination][Data Destination]].
151 - =$rsync_username=, =$rsync_password=: credentials of (and only
152 known to) the Rsync server;
153 cf. setup of [[installation#Data_Destination][Data Destination]].
156 *** Automatic Program Start
159 =/home/m-operator/.profile= (create it if necessary):
162 /home/m-operator/monikop/monikop
168 /home/m-operator/monikop/pokinom,
173 If necessary, specify path to config file, e.g.
175 /home/m-operator/monikop/monikop /home/m-operator/monikop/monikop.config
181 On both Monikop's and Pokinom's host authorize m-operator to shut down computer.
182 Use =visudo= to change =/etc/sudoers=; add:
185 m-operator ALL=(ALL) NOPASSWD: /sbin/halt -p
186 m-operator ALL=(ALL) NOPASSWD: /sbin/reboot
192 On both Monikop's and Pokinom's host, change the line in
193 =/etc/inittab= that looks like
196 1:2345:respawn:/sbin/getty 38400 tty1
202 1:2345:respawn:/sbin/mingetty --autologin m-operator --noclear tty1
206 #Configure_Rsync_on_Sources
207 ** Configure Rsync on Sources
209 Install package rsync.
211 Example for =/etc/rsyncd.conf=:
214 pid file=/var/run/rsyncd.pid
218 lock file = /var/lock/rsyncd
221 transfer logging = false
224 In =/etc/default/rsync=, change the line
238 =# /etc/initd/rsync start=
244 [[http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download][cwRsync]]. Click
245 Start, Programs, cwRsyncServer, rsyncd.conf; edit:
253 # /cygdrive/e/log stands for E:\log
254 path = /cygdrive/e/log
256 transfer logging = false
259 Configure service rsync for automatic start.
265 Depending on the amount of data to transfer, consider putting a
266 dedicated NIC for each Source into Monikop's machine. In this case,
267 you should provide for non-overlapping subnets. [[http://jodies.de/ipcalc][IP-Calculator]] may be
273 **** Name the Sources
276 Example for =/etc/hosts=:
280 192.168.200.10 data-producer1
281 192.168.200.20 data-producer2
282 192.168.200.30 data-producer3
283 192.168.200.50 data-producer4
284 192.168.178.1 monikop
290 Example for =/etc/network/interfaces=:
292 # The loopback network interface
294 iface lo inet loopback
296 # Net of smaller Sources
298 iface eth1 inet static
299 address 192.168.178.1
300 netmask 255.255.255.0
302 # Dedicated NIC for data-producer1
304 iface eth2 inet static
305 address 192.168.200.9
306 netmask 255.255.255.248
308 # Dedicated NIC for data_producer2
310 iface eth3 inet static
311 address 192.168.200.19
312 netmask 255.255.255.248
314 # Dedicated NIC for data_producer3
316 iface eth4 inet static
317 address 192.168.200.29
318 netmask 255.255.255.248
320 # Dedicated NIC for data_producer4
322 iface eth5 inet static
323 address 192.168.200.49
324 netmask 255.255.255.248
330 Use [[installation#etc_hosts][/etc/hosts]] as with Monikop. For Windows, it's =%SystemRoot%\system32\drivers\etc\hosts=.
335 Example for =/etc/network/interfaces=:
339 iface lo inet loopback
341 # service (not relevant for Monikop)
343 iface eth0 inet static
344 address 192.168.178.2
345 netmask 255.255.255.0
347 # Monikop's dedicated NIC
349 iface eth1 inet static
350 address 192.168.200.10
351 netmask 255.255.255.248
354 For Windows, configure your network settings accordingly.
359 Pokinom's network settings don't need any special treatment. Just
360 integrate it into the office LAN Destination is connected to.
366 *** Rsync Server on Destination
368 Install package rsync.
370 Adapt =/etc/rsyncd.conf=, e.g.:
373 gid = data_receiving_group
376 pid file = /var/run/rsyncd.pid
381 comment = Pokinom only; requires authentication
383 incoming chmod = g+r,g+w
386 hosts allow = 192.168.180.120
387 auth users = m-operator
388 secrets file = /etc/rsyncd.secrets
391 =/etc/rsyncd.secrets= contains Rsync's credentials which must
392 correspond to settings =$rsync_passwd= and =$rsync_username= in [[installation#pokinom.config][pokinom.config]]
398 In =/etc/default/rsync=, change the line
412 =# /etc/initd/rsync start=
416 With the above, rsync puts the payload it receives into
417 =/mnt/raid_0/NEW_DATA/=. ("=NEW_DATA=" was set with
418 =$destination= in [[installation#pokinom.config][pokinom.config]].)
420 =NEW_DATA/= and everything inside belongs to user
421 nobody and group data_receiving_group.
423 If on Destination you can't do without Windows, install
424 [[http://sourceforge.net/projects/sereds/files/cwRsync/4.0.3/cwRsyncServer_4.0.3_Installer.zip/download][cwRsync]],
425 configure its =rsyncd.conf= accordingly, and set service rsync to
428 ; TODO: net topology for Monikop, for Pokinom