blob: 18294853b3780b21d084eccf99e384c7a3df7981 [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
Jiri Broulike6626202018-02-28 16:22:20 +010096
97Backup server without strict client restriction
98
99.. code-block:: yaml
100
101 xtrabackup:
102 server:
103 restrict_clients: false
104
105Client restore from local backups:
Jiri Broulik634ea8a2017-05-31 17:10:03 +0200106
107.. code-block:: yaml
108
109 xtrabackup:
110 client:
111 enabled: true
112 full_backups_to_keep: 5
113 hours_before_full: 48
114 hours_before_incr: 12
115 restore_full_latest: 1
116 restore_from: local
117 compression: true
118 compressThreads: 2
119 database:
120 user: username
121 password: password
122 target:
123 host: cfg01
124 qpress:
125 source: tar
126 name: url
127
128 .. 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
129
130
131Client restore from remote backups:
132
133.. code-block:: yaml
134
135 xtrabackup:
136 client:
137 enabled: true
138 full_backups_to_keep: 5
139 hours_before_full: 48
140 hours_before_incr: 12
141 restore_full_latest: 1
142 restore_from: remote
143 compression: true
144 compressThreads: 2
145 database:
146 user: username
147 password: password
148 target:
149 host: cfg01
150 qpress:
151 source: tar
152 name: url
153
154 .. 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
155
156
157More information
158================
159
160* https://labs.riseup.net/code/projects/xtrabackup/wiki/Configuration
161* http://www.debian-administration.org/articles/351
162* http://duncanlock.net/blog/2013/08/27/comprehensive-linux-backups-with-etckeeper-xtrabackup/
163* https://github.com/riseuplabs/puppet-xtrabackup
164* http://www.ushills.co.uk/2008/02/backup-with-xtrabackup.html
165
166
167Documentation and Bugs
168======================
169
170To learn how to install and update salt-formulas, consult the documentation
171available online at:
172
173 http://salt-formulas.readthedocs.io/
174
175In the unfortunate event that bugs are discovered, they should be reported to
176the appropriate issue tracker. Use Github issue tracker for specific salt
177formula:
178
179 https://github.com/salt-formulas/salt-formula-xtrabackup/issues
180
181For feature requests, bug reports or blueprints affecting entire ecosystem,
182use Launchpad salt-formulas project:
183
184 https://launchpad.net/salt-formulas
185
186You can also join salt-formulas-users team and subscribe to mailing list:
187
188 https://launchpad.net/~salt-formulas-users
189
190Developers wishing to work on the salt-formulas projects should always base
191their work on master branch and submit pull request against specific formula.
192
193 https://github.com/salt-formulas/salt-formula-xtrabackup
194
195Any questions or feedback is always welcome so feel free to join our IRC
196channel:
197
198 #salt-formulas @ irc.freenode.net
199