blob: 82b14f684af421aebfe7cb6a942404a72d321374 [file] [log] [blame]
Jiri Broulik634ea8a2017-05-31 17:10:03 +02001
2===================
3xtrabackup formula
4===================
5
6Xtrabackup allows you to backup and restore databases from full backups or full backups and its incrementals.
7
8
9Sample pillars
10==============
11
12Backup client with ssh/rsync remote host
13
14.. code-block:: yaml
15
16 xtrabackup:
17 client:
18 enabled: true
19 full_backups_to_keep: 3
20 hours_before_full: 48
21 hours_before_incr: 12
22 database:
23 user: username
24 password: password
25 target:
26 host: cfg01
27
28 .. note:: full_backups_to_keep param states how many backup will be stored locally on xtrabackup client.
29 More options to relocate local backups can be done using salt-formula-backupninja.
30
31
32Backup client with local backup only
33
34.. code-block:: yaml
35
36 xtrabackup:
37 client:
38 enabled: true
39 full_backups_to_keep: 3
40 hours_before_full: 48
41 hours_before_incr: 12
42 database:
43 user: username
44 password: password
45
46 .. note:: full_backups_to_keep param states how many backup will be stored locally on xtrabackup client
47
48
Marcin Iwinskif74b9532017-09-28 16:30:47 +020049Backup client with ssh/rsync to remote host with compression and non-default backup directory on server:
Jiri Broulik634ea8a2017-05-31 17:10:03 +020050
51.. code-block:: yaml
52
53 xtrabackup:
54 client:
55 enabled: true
56 full_backups_to_keep: 3
57 hours_before_full: 48
58 hours_before_incr: 12
59 compression: true
60 compression_threads: 2
61 database:
62 user: username
63 password: password
64 target:
65 host: cfg01
Marcin Iwinskif74b9532017-09-28 16:30:47 +020066 server:
67 enabled: false
68 backup_dir: /srv/backup
Jiri Broulik634ea8a2017-05-31 17:10:03 +020069
70 .. note:: More options to relocate local backups can be done using salt-formula-backupninja.
71
Marcin Iwinskif74b9532017-09-28 16:30:47 +020072 .. note:: If the ``server`` section is ommited backups will be made to
73 default location, same on both client and server side.
Jiri Broulik634ea8a2017-05-31 17:10:03 +020074
Marcin Iwinskif74b9532017-09-28 16:30:47 +020075
76Backup server rsync and non-default backup directory:
Jiri Broulik634ea8a2017-05-31 17:10:03 +020077
78.. code-block:: yaml
79
80 xtrabackup:
81 server:
82 enabled: true
83 hours_before_full: 48
84 full_backups_to_keep: 5
85 key:
86 xtrabackup_pub_key:
87 enabled: true
88 key: key
Marcin Iwinskif74b9532017-09-28 16:30:47 +020089 backup_dir: /srv/backup
Jiri Broulik634ea8a2017-05-31 17:10:03 +020090
91 .. note:: hours_before_full param should have the same value as is stated on xtrabackup client
92
Marcin Iwinskif74b9532017-09-28 16:30:47 +020093 .. note:: If the ``backup_dir`` argument is ommited backups will be made to
94 default location, same on both client and server side.
Jiri Broulik634ea8a2017-05-31 17:10:03 +020095
96Client restore from local backups:
97
98.. code-block:: yaml
99
100 xtrabackup:
101 client:
102 enabled: true
103 full_backups_to_keep: 5
104 hours_before_full: 48
105 hours_before_incr: 12
106 restore_full_latest: 1
107 restore_from: local
108 compression: true
109 compressThreads: 2
110 database:
111 user: username
112 password: password
113 target:
114 host: cfg01
115 qpress:
116 source: tar
117 name: url
118
119 .. note:: restore_full_latest param with a value of 1 means to restore db from the last full backup and its increments. 2 would mean to restore second latest full backup and its increments
120
121
122Client restore from remote backups:
123
124.. code-block:: yaml
125
126 xtrabackup:
127 client:
128 enabled: true
129 full_backups_to_keep: 5
130 hours_before_full: 48
131 hours_before_incr: 12
132 restore_full_latest: 1
133 restore_from: remote
134 compression: true
135 compressThreads: 2
136 database:
137 user: username
138 password: password
139 target:
140 host: cfg01
141 qpress:
142 source: tar
143 name: url
144
145 .. note:: restore_full_latest param with a value of 1 means to restore db from the last full backup and its increments. 2 would mean to restore second latest full backup and its increments
146
147
148More information
149================
150
151* https://labs.riseup.net/code/projects/xtrabackup/wiki/Configuration
152* http://www.debian-administration.org/articles/351
153* http://duncanlock.net/blog/2013/08/27/comprehensive-linux-backups-with-etckeeper-xtrabackup/
154* https://github.com/riseuplabs/puppet-xtrabackup
155* http://www.ushills.co.uk/2008/02/backup-with-xtrabackup.html
156
157
158Documentation and Bugs
159======================
160
161To learn how to install and update salt-formulas, consult the documentation
162available online at:
163
164 http://salt-formulas.readthedocs.io/
165
166In the unfortunate event that bugs are discovered, they should be reported to
167the appropriate issue tracker. Use Github issue tracker for specific salt
168formula:
169
170 https://github.com/salt-formulas/salt-formula-xtrabackup/issues
171
172For feature requests, bug reports or blueprints affecting entire ecosystem,
173use Launchpad salt-formulas project:
174
175 https://launchpad.net/salt-formulas
176
177You can also join salt-formulas-users team and subscribe to mailing list:
178
179 https://launchpad.net/~salt-formulas-users
180
181Developers wishing to work on the salt-formulas projects should always base
182their work on master branch and submit pull request against specific formula.
183
184 https://github.com/salt-formulas/salt-formula-xtrabackup
185
186Any questions or feedback is always welcome so feel free to join our IRC
187channel:
188
189 #salt-formulas @ irc.freenode.net
190