Backup service » History » Version 1

Bruno STEVANT, 07/19/2018 02:17 PM

1 1 Bruno STEVANT
h1. Configuration Backup and Versioning service
2 1 Bruno STEVANT
3 1 Bruno STEVANT
*Disclaimer* This service is for the moment dedicated for NOC managed servers and equipments. It could be extended to servers inside research platforms (but use it with care). This service is far from being production-ready.
4 1 Bruno STEVANT
5 1 Bruno STEVANT
h2. Storage solutions
6 1 Bruno STEVANT
7 1 Bruno STEVANT
All backups are saved in the additional disk storage of the [[Hermes]] server. A partition is dedicated for backup'd content ("Current usage":http://rsm.enstb.fr/graphs/graph_8.html).
8 1 Bruno STEVANT
9 1 Bruno STEVANT
Some configurations can also be stored inside the SVN versioning system provided by TB
10 1 Bruno STEVANT
 https://svn.telecom-bretagne.eu/repository/noc-rsm/
11 1 Bruno STEVANT
This repository is also accessible from the "redmine tools":/projects/srcd-disi-noc/repository/noc-rsm/entry/
12 1 Bruno STEVANT
13 1 Bruno STEVANT
h2. Backup of network equipments configuration (rancid)
14 1 Bruno STEVANT
15 1 Bruno STEVANT
Rancid is a tool to backup configuration of network equipments through the remote administration console (ie. does not work with web-only admin consoles). Based on a database of the network equipments, the rancid script connects to each console to backup the configuration.
16 1 Bruno STEVANT
17 1 Bruno STEVANT
h3. Current installation details
18 1 Bruno STEVANT
19 1 Bruno STEVANT
* Server: [[Hermes]]
20 1 Bruno STEVANT
* Process: rancid
21 1 Bruno STEVANT
* Launch from: rancid user crontab
22 1 Bruno STEVANT
** TODO: Backup this file ?
23 1 Bruno STEVANT
* Config file: (hermes)/usr/local/rancid/etc/rancid.conf
24 1 Bruno STEVANT
** TODO: Backup this file
25 1 Bruno STEVANT
* Equipments databases:
26 1 Bruno STEVANT
** "RSM-B25":/projects/srcd-disi-noc/repository/noc-rsm/entry/rancid/rsm-b25/router.db
27 1 Bruno STEVANT
** "Labo4g":/projects/srcd-disi-noc/repository/noc-rsm/entry/rancid/labo4g/router.db
28 1 Bruno STEVANT
29 1 Bruno STEVANT
Passwords are stored in the .cloginrc file in the rancid user homedir.
30 1 Bruno STEVANT
* TODO: Backup this file ?
31 1 Bruno STEVANT
32 1 Bruno STEVANT
h3. Versionning in the noc-rsm svn project
33 1 Bruno STEVANT
34 1 Bruno STEVANT
Rancid write the configurations in a "subdirectory":/projects/srcd-disi-noc/repository/noc-rsm/entry/rancid. The rancid process performs a commit after completion of the backup (parameters for the svn commit are in rancid.conf).
35 1 Bruno STEVANT
36 1 Bruno STEVANT
*Note* the automatic commit to the versioning system requires to hardcode credentials to authenticate with the HTTP SVN server of TB :(
37 1 Bruno STEVANT
* TODO: Fix this by switching to ssh ? 
38 1 Bruno STEVANT
** *Note* git can also be an alternative solution for this, but step one is to open a local service before going to production.
39 1 Bruno STEVANT
40 1 Bruno STEVANT
h2. Backup of servers configuration and content (saved)
41 1 Bruno STEVANT
42 1 Bruno STEVANT
Backup for Linux servers is done by a simple home-made script, named saved. This tool allow mirroring of servers configuration and content in a central storage.
43 1 Bruno STEVANT
44 1 Bruno STEVANT
First, this tool daily performs a local backup on the host by copying specified directories into one backup directory. A database backup can also be performed. Data are locally accessible through the directory /backup/{files,databases}.
45 1 Bruno STEVANT
46 1 Bruno STEVANT
Each local backup tree+db is then rsync'd from [[Hermes]] to a directory in its additional storage (/sauv/hosts/<host>/{files,databases}). Rsync is done through ssh, authenticated by public key.
47 1 Bruno STEVANT
48 1 Bruno STEVANT
h3. Current installation details
49 1 Bruno STEVANT
50 1 Bruno STEVANT
Local backup on hosts:
51 1 Bruno STEVANT
* Server: <host to backup>
52 1 Bruno STEVANT
* Process: sauv.daily
53 1 Bruno STEVANT
** "Source of the script":/projects/srcd-disi-noc/repository/noc-rsm/entry/tools/saved/local/sauv.daily
54 1 Bruno STEVANT
* Launch by: /etc/crontab
55 1 Bruno STEVANT
* Config file (example): source:tools/saved/local/a_sauvegarder
56 1 Bruno STEVANT
** One line per directory to be backup'd
57 1 Bruno STEVANT
58 1 Bruno STEVANT
Remote backup of hosts local backup:
59 1 Bruno STEVANT
* Server: [[Hermes]]
60 1 Bruno STEVANT
* Process: save
61 1 Bruno STEVANT
** "Source of the script":/projects/srcd-disi-noc/repository/noc-rsm/entry/tools/saved/remote/save
62 1 Bruno STEVANT
* Launch by: saved user crontab
63 1 Bruno STEVANT
* "Config file (example)":/projects/srcd-disi-noc/repository/noc-rsm/entry/tools/saved/remote/save.d/fqdn.host.sauv
64 1 Bruno STEVANT
** One line per directory to be backup'd
65 1 Bruno STEVANT
** Filename needs to be the host FQDN
66 1 Bruno STEVANT
67 1 Bruno STEVANT
*Note*: To rsync to the targeted host, the public key of the saved user needs to be authorized by a local saved user on the host. Be sure to verify that the Hermes saved user can log directly without password to the host.
68 1 Bruno STEVANT
69 1 Bruno STEVANT
h3. Versionning in the noc-rsm svn project
70 1 Bruno STEVANT
71 1 Bruno STEVANT
Some part of the backup trees available on hermes in /sauv/hosts/ can be part of the noc-rsm subversion directory. This allow each modification of backup'd content to be journalized.
72 1 Bruno STEVANT
73 1 Bruno STEVANT
How to enable versioning of a part of the backup tree:
74 1 Bruno STEVANT
* Create and commit an empty directory into the noc-rsm repository.
75 1 Bruno STEVANT
* Checkout this directory in the backup tree at the targeted directory. 
76 1 Bruno STEVANT
* Add all files and sub-directory then commit.
77 1 Bruno STEVANT
* The remote backup script will commit automatically after rsync (provided the svn authentication works) (test of the presence of a .ssh directory)
78 1 Bruno STEVANT
79 1 Bruno STEVANT
Example: source:/projects/srcd-disi-noc/repository/noc-rsm/entry/config/rhada.ipv6.enstb.fr