Installing Percona Backup for MongoDB

Percona provides and supports installation packages for Percona Backup for MongoDB in the deb and rpm formats that you can install by using apt or yum or other interfaces to your package management system.

The Percona Software and Platform Lifecycle page lists Linux distributions for which Percona Backup for MongoDB installation packages are available.

For your convenience, we recommend that you install the percona-release utility which makes it easy to install any Percona product on your system.

You may also build and install Percona Backup for MongoDB from source code in case you require a fully controlled installation method.

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

You should install pbm-agent on every server that has mongod nodes in the MongoDB cluster (or non-sharded replica set). The pbm CLI can be installed 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.

See also

More information about percona-release
https://www.percona.com/doc/percona-repo-config/percona-release.html

Prerequisites

It is recommended to install Percona Backup for MongoDB from official Percona repositories by using the percona-release utility.

$ percona-release enable tools

Percona Backup for MongoDB is available for installation from your package management system when you enable the tools repository.

See also

Configuring Percona repositories
https://www.percona.com/doc/percona-repo-config/index.html

Installing Percona Backup for MongoDB Using apt

$ apt update
$ apt install percona-backup-mongodb

Installing Percona Backup for MongoDB Using yum

$ yum update
$ yum install percona-backup-mongodb

Building from source code

Building the project requires:

  • Go 1.11 or above
  • make

See also

Installing and setting up Go tools
https://golang.org/doc/install

To build the project (from the project dir):

$ go get -d github.com/percona/percona-backup-mongodb
$ cd "$(go env GOPATH)/src/github.com/percona/percona-backup-mongodb"
$ make

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]

Percona Backup for MongoDB services and location of configuration files

After Percona Backup for MongoDB is successfully installed on your system, you have pbm and pbm-agent programs on your system.

Configuring service init scripts

The MongoDB connection URI string to the local mongod node should be set in the environment file that the pbm-agent.service systemd unit file includes.

With the current systemd unit file (see below), this means setting the “PBM_MONGODB_URI” environment variable in /etc/default/pbm-agent (for Debian and Ubuntu) or /etc/sysconfig/pbm-agent (for Red Hat or CentOS).


The Running Percona Backup for MongoDB section, explains in detail how to start pbm-agent and provides examples how to use pbm commands.

Hint

In Ubuntu and Debian pbm-agent.service is located in the /lib/systemd/system/ directory. In Red Hat and CentOS, this file is found in /usr/lib/systemd/system/pbm-agent.service.

[Unit]
Description=pbm-agent
After=time-sync.target network.target

[Service]
EnvironmentFile=-/etc/default/pbm-agent
Type=simple
User=pbm
Group=pbm
PermissionsStartOnly=true
ExecStart=/usr/bin/pbm-agent

[Install]
WantedBy=multi-user.target

See also

More information about standard MongoDB connection strings
Authentication