Installing Percona Backup for MongoDB¶
Percona provides and supports Percona Backup for MongoDB installation packages for Debian, Ubuntu, Red Hat Enterprise Linux and CentOS Linux distributions. Find detailed information about supported Linux distributions on the Percona Software and Platform Lifecycle page.
You can install Percona Backup for MongoDB in one of the following ways:
build from source code if you want full control over the installation
download packages from Percona website and install them using the package manager of your operating system
Alternatively, you can run Percona Backup for MongoDB in a Docker container
Regardless of the installation method you choose, the following tools are at your disposal after the installation completes:
Tool |
Purpose |
|---|---|
pbm |
Command-line interface for controlling the backup system |
pbm-agent |
An agent for running backup/restore actions on a database host |
pbm-speed-test |
An interface for field-testing compression and backup upload speed |
Install pbm-agent on every server that has mongod nodes in the
MongoDB cluster (or non-sharded replica set). You don’t need to install pbm-agent on arbiter nodes since they don’t have the data set.
You can install pbm CLI
on any or all servers or desktop computers you wish to use it from, so long as
those computers aren’t network-blocked from accessing the MongoDB cluster.
Installing from Percona repositories¶
This is the recommended installation method. Percona provides the percona-release configuration tool that simplifies operating repositories and enables to install and update both Percona Backup for MongoDB packages and required dependencies smoothly.
Install percona-release tool using the package manager of your operating system. Follow the instructions in Percona Software repositories documentation to install percona-release.
Enable the repository. As of version 1.3.0, Percona Backup for MongoDB packages are stored in the pbm repository.
$ sudo percona-release enable pbm release
Install Percona Backup for MongoDB on Debian and Ubuntu¶
Reload the local package database:
$ sudo apt update
Install Percona Backup for MongoDB:
$ sudo apt install percona-backup-mongodb
Install Percona Backup for MongoDB on Red Hat Enterprise Linux and CentOS¶
Use the following command to install Percona Backup for MongoDB:
$ sudo yum install percona-backup-mongodb
Building from source code¶
Building the project requires:
Go 1.11 or above
make
git
krb5-develfor Red Hat Enterprise Linux / CentOS orlibkrb5-devfor Debian / Ubuntu. This package is required for Kerberos authentication in Percona Server for MongoDB.
See also
- Installing and setting up Go tools
To build the project (from the project dir):
$ git clone https://github.com/<your_name>/percona-backup-mongodb
$ cd percona-backup-mongodb
$ make build
After make completes, you can find pbm and pbm-agent binaries
in the ./bin directory:
$ cd bin
$ ./pbm version
By running pbm version, you can verify if Percona Backup for MongoDB has been built correctly and is ready for use.
Output
Version: [pbm version number]
Platform: linux/amd64
GitCommit: [commit hash]
GitBranch: master
BuildTime: [time when this version was produced in UTC format]
GoVersion: [Go version number]
Tip
Instead of specifying the path to pbm binaries, you can add it to the PATH environment variable:
export PATH=/percona-backup-mongodb/bin:$PATH
Download packages from Percona website¶
You can download installation packages specific for your operating system from Percona website and install them using dpkg (Debian and Ubuntu) or rpm (Red Hat Enterprise Linux and CentOS). However, you must make sure that all dependencies are satisfied.
Alternatively, you can download and install Percona Backup for MongoDB from binary tarballs.
Install from binary tarball¶
Find the link to the binary tarballs under the Generic Linux menu item on Percona website.
Fetch the binary tarball.
$ wget https://downloads.percona.com/downloads/percona-backup-mongodb/percona-backup-mongodb-1.5.0/binary/tarball/percona-backup-mongodb-1.5.0-x86_64.tar.gz
Extract the tarball
$ tar -xf percona-backup-mongodb-1.5.0-x86_64.tar.gz
Export the location of the binaries to the
PATHvariable. For example, if you’ve extracted the tarball to yourhomedirectory, the command would be the following:$ export PATH=~/percona-backup-mongodb-1.5.0/:$PATH
After Percona Backup for MongoDB is successfully installed on your system, you have pbm
and pbm-agent programs available. See Initial setup for guidelines how to set up Percona Backup for MongoDB.