Debian Codegraph @

doc/rear-presentation.adoc

raw
1 = Relax-and-Recover: Disaster Recovery and System Migration solution (2015)
2 Dag Wieers <[email protected]>
3
4 _This presentation is written in AsciiDoc and can be converted to
5 a LibreOffice/OpenOffice presentation using
6 http://github.com/dagwieers/asciidoc-odf[asciidoc-odf]._
7
8
9 ////
10 == Who is Dag Wieers ?
11 * Linux and Open Source consultant
12 - Worked at IBM Belgium, now self-employed to provide advice, design, automation, maintenance
13
14 * Involved in various Open Source communities
15 - incl. RPMforge, ELRepo, CentOS, syslinux, AsciiDoc, LibreOffice,
16 docbook2odf, Relax-and-Recover
17
18 * Author of various tools
19 - incl. dstat, unoconv, mrepo, proxytunnel, wiipresent, dconf, asciidoc-odf
20 ////
21
22
23 == What is Relax-and-Recover ?
24 _Tool that implements a DR workflow for Linux_
25
26 Which basically means ?
27
28 - Easy to deploy (set up and forget)
29 - Makes recovery as easy as possible
30 - Complete bare-metal disaster recovery
31 - Integration for various Linux technologies
32 - Integration with various back-up solutions
33 - Modular framework written in Bash
34 - Easy to extend to own needs
35
36
37 == How does Relax-and-Recover work ?
38 Relax-and-Recover builds a rescue image from the existing installation
39
40 - Restored system is an accurate copy
41 - Restored system supports the hardware
42 - Exotic setups (kernel, hardware) guaranteed to work
43 - What worked before keeps on working
44 - Recovery is fully automated
45
46 Backup software is integrated into rescue image
47
48 - With a working configuration
49
50
51 == Why is a backup not sufficient ?
52 Backup only covers storing data safely/securely
53
54 - Often only the data is available
55 - DR is a manual and time-consuming process
56
57 So manual disaster recovery risks:
58
59 - unknown system storage and network configuration
60 - incompatibilities between firmware/software/hardware
61 * using newer tools with older data (or vice versa)
62 * hardware is not supported
63 - making manual mistakes (again and again)
64 - working against the clock amidst chaos
65 - frustration
66
67
68 == What does Relax-and-Recover bring to the table ?
69 But the Relax-and-Recover rescue image takes care of the complete
70 recovery process until the system runs:
71
72 - enabling the network and remote access
73 - using tools to recreate an accurate/working copy
74 - recreating hardware and software RAID
75 - partitioning and creating file systems
76 - starting the backup restore process
77 - restoring the bootloader
78
79
80 == Relax-and-Recover functionality
81 * Supported storage technologies
82 - HP SmartArray, SW RAID, DRBD, LVM, multipath
83 - ext2/ext3/ext4, xfs, jfs, vfat, btrfs, LUKS
84
85 * Boot media or remote storage
86 - OBDR tape, ISO, USB, eSATA, network booting
87 - NFS, CIFS, rsync, HTTP, FTP, SFTP, ...
88
89 * Back-up backends
90 - IBM TSM, Micro Focus Data Protector, Symantec NetBackup,
91 FDR/Upstream, Bacula, tar, rsync, Borg
92
93
94 == How is Relax-and-Recover used ?
95 * Creating boot media: +rear mkrescue+
96 - Copies kernel, modules, minimal system
97 - Saves storage layout, network configuration
98 - Write boot media
99
100 * Restore system
101 - Boot Relax-and-Recover media
102 - Optionally, modify storage/network config
103 - Run: +rear recover+
104 - Relax-and-Recover parses layout then creates diskrestore script
105 - Relax-and-Recover initiates restore or prompts for restore
106
107 == Relax-and-Recover on a running system
108
109 [ditaa]
110 ----
111 /-------------+ /-----------+ /-----------+
112 | Storage | | Collect | | Integrate |
113 | layout | ----> | new | ----> | required |
114 | change | | storage | | backup |
115 | detected | | layout | | strategy |
116 +-------------/ +-----------/ +-----------/
117
118 |
119 V
120
121 /-------------+ /-----------+ /-----------+
122 | Off-site | | Push | | Create |
123 | storage | <---- | recovery | <---- | new |
124 | together | | image | | recovery |
125 | with backup | | centrally | | image |
126 +-------------/ +-----------/ +-----------/
127 ----
128
129 == Nifty features to help relax
130 * Local GRUB integration (password protected)
131
132 * Serial console support (think: disaster)
133
134 * History-stuffing during recovery
135
136 * Network and SSH key integration
137
138 * Layout code guides you through recovery
139 - Menu's and command-line in one session
140 - Provides original storage info
141
142 * Beep, UID led and USB suspend integration
143
144 * Syslinux management
145
146 * Log-file on recovery media
147
148
149 == Use case: Belgian Federal Police /1
150 * Requirements:
151 - About 200 sites with each a set of Linux servers
152 - Each server comes with a tape-drive
153 - Single bootable tape to:
154 ** Restore complete system
155 ** Restore from back-up
156 - Support for various technologies
157 ** HP SmartArray, SW RAID, DRBD, LVM
158 ** OBDR, Bacula tape support
159 ** RHEL 4, RHEL5 and RHEL6 support
160 - End-user documentation in 3 languages
161
162
163 == Use case: Belgian Federal Police /2
164 * Solution:
165 - All requirements implement but...
166 - New systems didn't support bootable tape (OBDR)
167 - USB is much more flexible than tape
168 ** Can store multiple rescue images
169 ** Can store rescue images of multiple servers
170 ** Easier workflow (udev): insert, wait, pull (2 min max)
171 ** Cheaper
172 ** Implementation is more reliable
173 - Bonus implementation of flexible layout
174 - Support migration scenarios
175
176
177 == Use case: Belgian Federal Police /3
178 * Relax-and-Recover config for USB rescue media:
179
180 [source,bash]
181 ----
182 BACKUP=BACULA
183 OUTPUT=USB
184 USB_DEVICE=/dev/disk/by-label/REAR-000
185 ----
186
187 * Relax-and-Recover config for USB backup media:
188
189 [source,bash]
190 ----
191 BACKUP=NETFS
192 OUTPUT=USB
193 USB_DEVICE=/dev/disk/by-label/REAR-000
194 ONLY_INCLUDE_VG=( vg00 )
195 EXCLUDE_MOUNTPOINTS=( /data )
196 ----
197
198
199 == Use case: Belgian Federal Police /4
200 * Relax-and-Recover config for OBDR rescue tapes:
201
202 [source,bash]
203 ----
204 BACKUP=BACULA
205 OUTPUT=OBDR
206 BEXTRACT_DEVICE=Ultrium-1
207 BEXTRACT_VOLUME=VOL-*
208 ----
209
210 * Relax-and-Recover config for OBDR backup tapes:
211
212 [source,bash]
213 ----
214 BACKUP=NETFS
215 OUTPUT=OBDR
216 TAPE_DEVICE=/dev/nst0
217 ----
218
219 == Use case: Centralized images /1
220 * Requirements:
221 - Remote rescue images
222 - Removable media for off-site storage
223 - Easy restore of physical hosts and guests
224
225 * Solution:
226 - Cron creates image when Relax-and-Recover detects change
227 - Images pushed through HTTP to PXE server/host
228 - Stored on USB disks, rotated every week
229
230
231 == Use case: Centralized images /2
232 * Label USB disk(s) and mount
233
234 * Configure Apache to allow HTTP PUT to USB disk
235
236 * Relax-and-Recover config in _/etc/rear/local.conf_:
237
238 [source,bash]
239 ----
240 BACKUP=BACULA
241 OUTPUT=ISO
242 ISO_URL=http://server:port/path/
243 ----
244
245 * Relax-and-Recover cron-job at /etc/cron.d/rear:
246 ----
247 30 0 1 * * root /usr/sbin/rear mkrescue
248 30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue
249 ----
250
251 == Relax-and-Recover command line /1
252
253 ----
254 [root@moria rear]# rear help
255
256 Usage: $PROGRAM [-h|--help] [-V|--version] [-dsSv] [-D|--debugscripts SET] [-c DIR] [-r KERNEL] [--] COMMAND [ARGS...]
257 -snip-
258 List of commands:
259 checklayout check if the disk layout has changed
260 dump dump configuration and system information
261 format format and label media for use with rear
262 mkbackup create rescue media and backup system
263 mkbackuponly backup system without creating rescue media
264 mkrescue create rescue media only
265 recover recover the system; valid during rescue
266 validate submit validation information
267
268 Use 'rear -v help' for more advanced commands.
269 ----
270
271 == Relax-and-Recover command line /2
272
273 ----
274 [root@moria rear]# rear help
275
276 Usage: $PROGRAM [-h|--help] [-V|--version] [-dsSv] [-D|--debugscripts SET] [-c DIR] [-r KERNEL] [--] COMMAND [ARGS...]
277
278 Available options:
279 -h --help usage information
280 -c DIR alternative config directory; instead of /etc/rear
281 -d debug mode; run many commands verbosely with debug messages in log file (also sets -v)
282 -D debugscript mode; log executed commands via 'set -x' (also sets -v and -d)
283 --debugscripts SET same as -d -v -D but debugscript mode with 'set -SET'
284 -r KERNEL kernel version to use; currently '4.12.13-123.45.67-default'
285 -s simulation mode; show what scripts are run (without executing them)
286 -S step-by-step mode; acknowledge each script individually
287 -v verbose mode; show messages what Relax-and-Recover is doing on the terminal
288 -V --version version information
289
290 -snip-
291 ----
292
293 == Hacking on Relax-and-Recover
294 * It is Bash !
295
296 *Join the mailinglist
297
298 * Understand modular framework and workflows
299 - Use: +rear -s <workflow>+
300
301 * Logging
302 - Logfile in: _/var/log/rear/rear-<hostname>.log_
303
304 * Debugging
305 - Verbose: +rear -v+
306 - Debug: +rear -d+
307 - Tracing: +rear -D+
308
309
310 == Project future
311 * Functionality
312 - Improved rsync support (like rsnapshot or rbme)
313 - More back-up backend integration
314 - PXE integration
315
316 * Development
317 - Re-organize code base
318 - Release management needs a process
319 - Website and documentation not up-to-date
320 - Change of development tools ?
321
322
323 == Development team
324 Consists of:
325
326 - Schlomo Schapiro (original author)
327 - Gratien D'haese (original author)
328 - Jeroen Hoekx (new contributor)
329 - Dag Wieers (new contributor)
330
331 and various other contributors
332
333 Development at Github
334
335 - http://relax-and-recover.org/
336 - [email protected]
337
338
339 == Thank you for listening
340 Any questions, ideas, pull-requests ?
341
342
343 == Live USB demo
344 * Demo USB/udev integration (check udev config !)
345 - Prepare USB stick: +rear format /dev/sdb+
346 - Re-insert USB stick and wait until light goes out
347
348 * Demo restore procedure (disable udev rule !)
349 - Boot from KVM virtual machine
350 - Re-insert USB stick and start virt-manager
351 - Create VM with 4GB disk and boot VM
352 - Show bash history and perform: +rear recover+
353 - Show menu system and modify sizes