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:
Command-line interface for controlling the backup system
An agent for running backup/restore actions on a database host
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
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.
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.
percona-release tool using the package manager of your operating system. Follow the instructions in Percona Software repositories documentation to install
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
Reload the local package database:
$ sudo apt update
Install Percona Backup for MongoDB:
$ sudo apt install percona-backup-mongodb
Use the following command to install Percona Backup for MongoDB:
$ sudo yum install percona-backup-mongodb
Building the project requires:
Go 1.15 or above
krb5-develfor Red Hat Enterprise Linux / CentOS or
libkrb5-devfor Debian / Ubuntu. This package is required for Kerberos authentication in Percona Server for MongoDB.
- Installing and setting up Go tools
To build the project (from the project dir):
$ git clone https://github.com/percona/percona-backup-mongodb $ cd percona-backup-mongodb $ make build
After make completes, you can find
pbm and pbm-agent binaries
$ 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.
Version: [pbm version number] Platform: linux/amd64 GitCommit: [commit hash] GitBranch: main BuildTime: [time when this version was produced in UTC format] GoVersion: [Go version number]
Instead of specifying the path to pbm binaries, you can add it to the
PATH environment variable:
Create the environment file:
The path for Debian and Ubuntu is
The path for RHEL and CentOS is
pbm-agent.servicesystemd unit file.
In Ubuntu and Debian, the
pbm-agent.servicesystemd unit file is at the path
In RHEL and CentOS, the path to this file is
pbm-agent.servicefile, specify the following:
[Unit] Description=pbm-agent After=time-sync.target network.target [Service] EnvironmentFile=-/etc/default/pbm-agent Type=simple User=mongod Group=mongod PermissionsStartOnly=true ExecStart=/usr/bin/pbm-agent [Install] WantedBy=multi-user.target
Make sure that the
ExecStartdirectory includes the Percona Backup for MongoDB binaries. Otherwise, copy them from the
./bindirectory of you installation path.
systemdaware of the new service:
$ sudo systemctl daemon-reload
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.
Find the link to the binary tarballs under the Generic Linux menu item on Percona website.
Fetch the binary tarball. Replace the <version> with the required version.
$ wget https://downloads.percona.com/downloads/percona-backup-mongodb/percona-backup-mongodb-<version>/binary/tarball/percona-backup-mongodb-<version>-x86_64.tar.gz
Extract the tarball
$ tar -xf percona-backup-mongodb-<version>-x86_64.tar.gz
Export the location of the binaries to the
PATHvariable. For example, if you’ve extracted the tarball to your
homedirectory, the command would be the following:
$ export PATH=~/percona-backup-mongodb-<version>/:$PATH
After Percona Backup for MongoDB is successfully installed on your system, you have
and pbm-agent programs available. See Initial setup for guidelines how to set up Percona Backup for MongoDB.