Start pbm-agent using the configuration file¶
Version added: 2.9.0
A pbm-agent
requires a MongoDB connection string URI to start. You can define it either via the environment variable or use the configuration file. The latter option enables you to specify additional configuration like the number of parallel connections for backups and custom logging configuration.
This document explains how to start a pbm-agent
using the configuration file. For how to use environment variables, see the Configure authentication in MongoDB
The steps vary slightly based on your installation method. In the following example, we provide all available configuration options for reference. Note that for initial pbm-agent
start, mongodb-uri
is mandatory.
For installation from packages¶
-
Create a configuration file. For example,
/etc/pbm-agent.yaml
./etc/pbm-agent.yamlmongodb-uri: mongodb://pbm:mysecret@localhost:27017/ backup: dump-parallel-collections: 10 log: path: "/var/log/pbm.json" level: "I" json: true
-
Modify the
pbm-agent.service
systemd unit file. Specify the path to the configuration file for theExecStart
parameter.pbm-agent.service.... [Service] .... ExecStart=/usr/bin/pbm-agent -f /etc/pbm-agent.yaml ....
-
Start the
pbm-agent
.$ sudo systemctl start pbm-agent
For installation from the source code and tarballs¶
For the initial pbm-agent
start, you require the credentials of a pbm
user. See the Create a pbm user section for how to create this user.
-
Create the configuration file. Specify the
pbm
user credentials in the MongoDB connection string URI./etc/pbm-agent.yamlmongodb-uri: mongodb://pbm:mysecret@localhost:27017/ backup: dump-parallel-collections: 10 log: path: "/var/log/pbm.json" level: "I" json: true
-
Check that you have exported the location of the PBM binaries to the
$PATH
variable -
Start the
pbm-agent
:$ pbm-agent -f /etc/pbm-agent.yaml
Created: April 11, 2025