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