You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Modular backup, archiving, upload and notification components
27
27
- Multi-threaded, single executable
28
+
- Auto-scales to number of available CPUs by default
28
29
29
30
Current Limitations
30
31
~~~~~~~~~~~~~~~~~~~
@@ -38,47 +39,56 @@ Requirements:
38
39
~~~~~~~~~~~~~
39
40
40
41
- Backup consistency depends on consistent server time across all
41
-
hosts. Server time **must be synchronized on all nodes** using ntpd
42
+
hosts! Server time **must be synchronized on all nodes** using ntpd
42
43
and a consistent time source or virtualization guest agent that
43
44
syncs time
44
45
- Must have 'mongodump' installed and specified if not at default:
45
46
*/usr/bin/mongodump*. Even if you do not run MongoDB 3.2+, it is
46
-
strongly recommended to use MongoDB 3.2+ binaries due to inline
47
-
compression, parallelism, etc
47
+
strongly recommended to use MongoDB 3.2+ mongodump binaries due
48
+
to inline compression and parallelism features
48
49
- Must have Python 2.7 installed
49
50
51
+
Releases
52
+
~~~~~~~~
53
+
54
+
Pre-built release binaries and packages are available on our `GitHub Releases Page <https://github.com/Percona-Lab/mongodb_consistent_backup/releases>`__. We recommend most users deploy mongodb_consistent_backup using these packages.
55
+
50
56
Build/Install
51
57
~~~~~~~~~~~~~
52
58
53
-
To build on CentOS/RedHat, you wil need the following packages (see
54
-
command):
59
+
To build on CentOS/RedHat, you will need the following packages installed:
55
60
56
61
::
57
62
58
-
yum install python python-devel python-virtualenv gcc git make libffi-devel openssl-devel
To install to default '*/usr/local/bin/mongodb-consistent-backup*\ ':
65
+
To build an CentOS/RedHat RPM of the tool *(recommended)*:
61
66
62
67
::
63
68
64
-
cd path/to/mongo_backup
65
-
make
66
-
make install
69
+
$ cd /path/to/mongodb_consistent_backup
70
+
$ make rpm
71
+
72
+
To build and install from source *(to default '/usr/local/bin/mongodb-consistent-backup')*:
67
73
68
-
Use the PREFIX= variable to change the installation path (*default:
69
-
/usr/local*), ie: ``make PREFIX=/usr install`` to install to:
70
-
'*/usr/bin/mongodb-consistent-backup*\ '.
74
+
::
75
+
76
+
$ cd /path/to/mongodb_consistent_backup
77
+
$ make
78
+
$ make install
79
+
80
+
Use the PREFIX= variable to change the installation path (*default: /usr/local*), ie: ``make PREFIX=/usr install`` to install to: '*/usr/bin/mongodb-consistent-backup*'.
71
81
72
82
MongoDB Authorization
73
83
~~~~~~~~~~~~~~~~~~~~~
74
84
75
-
If your replset/cluster uses `Authentication <https://docs.mongodb.com/manual/core/authentication>`__, you must add a user with the "backup" and "clusterMonitor" built-in auth roles.
85
+
If your replset/cluster uses `Authentication <https://docs.mongodb.com/manual/core/authentication>`__, you must add a user with the `"backup" <https://docs.mongodb.com/manual/reference/built-in-roles/#backup>`__ and `"clusterMonitor"<https://docs.mongodb.com/manual/reference/built-in-roles/#clusterMonitor>`__ built-in auth roles.
76
86
77
87
To create a user, execute the following **replace the 'pwd' field with a secure password!**:
78
88
79
89
::
80
90
81
-
db.createUser({
91
+
db.getSiblingDB("admin").createUser({
82
92
user: "mongodb_consistent_backup",
83
93
pwd: "PASSWORD-HERE",
84
94
roles: [
@@ -94,36 +104,44 @@ Run a Backup
94
104
95
105
**Using Command-Line Flags**
96
106
107
+
*Note: username+password is visible in process lists when set using the command-line flags. Use a config file (below) to hide credentials!*
The tool supports a YAML-based config file for settings. The config file is loaded first and any additional command-line arguments override the file based config settings.
An example *(with comments)* of the YAML-based config file is here: `conf/mongodb-consistent-backup.example.conf <conf/mongodb-consistent-backup.example.conf>`__.
127
+
128
+
A description of all available config settings can also be listed by passing the '--help' flag to the tool.
129
+
112
130
Restore a Backup
113
131
~~~~~~~~~~~~~~~~
114
132
115
-
The backups are mongorestore compatible. The *--oplogReplay* flag **MUST** be present to replay the oplogs to ensure consistency.
133
+
The backups are mongorestore compatible and stored in a directory per backup. The *--oplogReplay* flag **MUST** be present to replay the oplogs to ensure consistency.
*Note: you need to use persistent volumes to store backups long-term on disk when using Docker. Data in Docker containers is destroyed when the container is deleted.*
144
+
*Note: you need to use persistent volumes to store backups and/or config files long-term when using Docker. Data in Docker containers is destroyed when the container is deleted.*
127
145
128
146
**Via Docker Hub**
129
147
@@ -143,12 +161,16 @@ Run as Docker Container (Experimental)
143
161
ZBackup Archiving (Optional)
144
162
~~~~~~~
145
163
146
-
`ZBackup <http://zbackup.org/>`__ *(with LZMA compression)* is an optional archive method for mongodb_consistent_backup. This archive method significantly reduces disk usage for backups via deduplication and compression.
164
+
*Note: the ZBackup archive method is not yet compatible with the 'Upload' phase. Disable uploading by setting 'upload.method' to 'none' in the meantime.*
165
+
166
+
`ZBackup <http://zbackup.org/>`__ *(with LZMA compression)* is an optional archive method for mongodb_consistent_backup. This archive method significantly reduces disk usage for backups via de-duplication and compression.
147
167
148
-
ZBackup offers block de-duplication and compression of backups and optionally supports AES-128 encryption at rest. The ZBackup archive method causes backups to be stored via ZBackup at archive time.
168
+
ZBackup offers block de-duplication and compression of backups and optionally supports AES-128 *(CBC mode with PKCS#7 padding)* encryption at rest. The ZBackup archive method causes backups to be stored via ZBackup at archive time.
149
169
150
170
To enable, ZBackup must be installed on your system and the 'archive.method' config file variable *(or --archive.method flag=)* must be set to 'zbackup'.
151
171
172
+
ZBackup's compression is most efficient when compression is disabled in the backup phase, to do this set 'backup.<method>.compression' to 'none'.
173
+
152
174
**Install on CentOS/RHEL**
153
175
154
176
::
@@ -161,21 +183,36 @@ To enable, ZBackup must be installed on your system and the 'archive.method' con
161
183
162
184
$ apt-get install zbackup
163
185
164
-
ZBackup data is stored in a repository directory named *mongodb_consistent_backup-zbackup* and must be restored using a 'zbackup restore ...' command.
165
186
166
-
**Get Backup from ZBackup Repo**
187
+
**Get Backup from ZBackup**
188
+
189
+
ZBackup data is stored in a storage directory named *'mongodb_consistent_backup-zbackup'* and must be restored using a 'zbackup restore ...' command.
190
+
191
+
::
192
+
193
+
$ zbackup restore --password-file /etc/zbackup.passwd /mnt/backup/default/mongodb_consistent_backup-zbackup/backups/20170424_0000.tar | tar -xf
194
+
195
+
**Delete Backup from ZBackup**
196
+
197
+
To remove a backup, first delete the .tar file in 'backups' subdir of the ZBackup storage directory. After, run a 'zbackup gc full' garbage collection to remove unused data.
0 commit comments