Skip to content

Configuration file options

This page describes configuration file options available in Percona Backup for MongoDB. For how to use configuration file, see Percona Backup for MongoDB configuration in a cluster (or non-sharded replica set).

Remote backup storage options

Percona Backup for MongoDB supports the following types of remote storages: - S3-compatible storage, - Microsoft Azure Blob storage, and - filesystem.

Percona Backup for MongoDB should work with other S3-compatible storage but was only tested with the following ones:

storage.type
Type

string

Required

YES

Remote backup storage type. Supported values: s3, filesystem, azure.

S3 type storage options

storage:
  type: s3
  s3:
    region: <string>
    bucket: <string>
    prefix: <string>
    credentials:
      access-key-id: <your-access-key-id-here>
      secret-access-key: <your-secret-key-here>
    serverSideEncryption:
      sseAlgorithm: aws:kms
      kmsKeyID: <your-kms-key-here>
storage.s3.provider
Type

string

Required

NO

The storage provider’s name. Supported values: aws, gcs

storage.s3.bucket
Type

string

Required

YES

The name of the storage bucket. See the AWS Bucket naming rules and GCS bucket naming guidelines for bucket name requirements

storage.s3.region
Type

string

Required

YES (for AWS and GCS)

The location of the storage bucket. Use the AWS region list and GCS region list to define the bucket region

storage.s3.prefix
Type

string

Required

NO

The path to the data directory on the bucket. If undefined, backups are stored in the bucket root directory

storage.s3.endpointUrl
Type

string

Required

YES (for MinIO and GCS)

The URL to access the bucket. The default value for GCS is https://storage.googleapis.com

storage.s3.credentials.access-key-id
Type

string

Required

YES

Your access key to the storage bucket. This option can be ommitted when you run Percona Backup for MongoDB using an EC2 instance profile. To learn more, refer to Automate access to S3 buckets for Percona Backup for MongoDB

storage.s3.credentials.secret-access-key
Type

string

Required

YES

The key to sign your programmatic requests to the storage bucket. This option can be ommitted when you run Percona Backup for MongoDB using an EC2 instance profile. To learn more, refer to Automate access to S3 buckets for Percona Backup for MongoDB

storage.s3.uploadPartSize
Type

int

Required

NO

The size of data chunks in bytes to be uploaded to the storage bucket. Default: 10MB

Percona Backup for MongoDB automatically increases the uploadPartSize value if the size of the file to be uploaded exceeds the max allowed file size. (The max allowed file size is calculated with the default values of uploadPartSize * maxUploadParts and is appr. 97,6 GB).

The uploadPartSize value is printed in the pbm-agent log.

By setting this option, you can manually adjust the size of data chunks if Percona Backup for MongoDB failed to do it for some reason. The defined uploadPartSize value overrides the default value and is used for calculating the max allowed file size

Server-side encryption options

serverSideEncryption.sseAlgorythm
Type

string

The key management mode used for server-side encryption

Supported value: aws:kms

serverSideEncryption.kmsKeyID
Type

string

Your customer-managed key

Filesystem storage options

storage:
  type: filesystem
  filesystem:
    path: <string>
storage.filesystem.path
Type

string

Required

YES

The path to the backup directory

Microsoft Azure Blob storage options

storage:
  type: azure
  azure:
    account: <string>
    container: <string>
    prefix: <string>
    credentials:
      key: <your-access-key>
storage.azure.account
Type

string

Required

YES

The name of your storage account.

storage.azure.container
Type

string

Required

YES

The name of the storage container. See the Container names for naming conventions.

storage.azure.prefix
Type

string

Required

NO

The path (sub-folder) to the backups inside the container. If undefined, backups are stored in the container root directory.

storage.azure.credentials.key
Type

string

Required

YES

Your access key to authorize access to data in your storage account.

Point-in-time recovery options

pitr:
  enabled: <boolean>
  oplogSpanMin: <float64>
pitr.enabled
Type

boolean

Enables point-in-time recovery

pitr.oplogSpanMin
Type

float64

Default

10

The duration of an oplog span in minutes. If set when the pbm-agent is making an oplog slice, the slice’s span is updated right away.

If the new duration is smaller than the previous one, the pbm-agent is triggered to save a new slice with the updated span. If the duration is larger, then the next slice is saved with the updated span in scheduled time.

Backup options

backup:
  priority:
    "localhost:28019": 2.5
    "localhost:27018": 2.5
    "localhost:27020": 2.0
    "localhost:27017": 0.1
priority
Type

array of strings

The list of mongod nodes and their priority for making backups. The node with the highest priority is elected for making a backup. If several nodes have the same priority, the one among them is randomly elected to make a backup.

If not set, the replica set nodes have the default priority as follows:

  • hidden nodes - 2.0,

  • secondary nodes - 1.0,

  • primary node - 0.5.

Restore options

restore:
  batchSize: <int>
  numInsertionWorkers: <int>
batchSize
Type

int

Default

500

The number of documents to buffer.

numInsertionWorkers
Type

int

Default

10

The number of workers that add the documents to buffer.