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,
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>
endpointUrl: <string>
credentials:
access-key-id: <your-access-key-id-here>
secret-access-key: <your-secret-key-here>
uploadPartSize: <int>
maxUploadParts: <int>
storageClass: <string>
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
storage.s3.maxUploadParts¶
- type:
int
- required:
NO
- default:
10,000
The maximum number of data chunks to be uploaded to the storage bucket. Default: 10,000
By setting this option, you can override the value defined in the AWS SDK.
It can be useful when using an S3 provider that supports a smaller number of chunks for multipart uploads.
The maxUploadParts
value is printed in the pbm-agent log.
storage.s3.storageClass¶
- type:
string
- required:
NO
The storage class assigned to objects stored in the S3 bucket. If not provided, the STANDARD
storage class will be used. This option is available in Percona Backup for MongoDB as of v1.7.0.
storage.s3.debugLogLevels¶
- type:
string
- required:
NO
Enables S3 debug logging for different types of S3 requests. S3 log messages are printed in the pbm logs
output.
Supported values are: LogDebug
, Signing
, HTTPBody
, RequestRetries
, RequestErrors
, EventStreamBody
.
To specify several event types, separate them by comma. To lean more about the event types, see the documentation
When undefined, no S3 debug logging is performed.
storage.s3.insecureSkipTLSVerify¶
- type:
bool
- default:
False
- required:
NO
Disables the TLS verification of the S3 storage. This allows Percona Backup for MongoDB to upload data to S3-like storages that use self-issued TLS certificates. Available in Percona Backup for MongoDB as of version 1.7.0.
Warning
Use this option with caution as it might leave a hole for man-in-the-middle attacks.
Server-side encryption options
serverSideEncryption.sseAlgorythm¶
- type:
string
- required:
NO
The key management mode used for server-side encryption
Supported value: aws:kms
serverSideEncryption.kmsKeyID¶
- type:
string
- required:
NO
Your customer-managed key
Upload retry options
retryer.numMaxRetries¶
- type:
int
- required:
NO
- default:
3
The maximum number of retries to upload data to S3 storage. A zero value means no retries will be performed. Available in Percona Backup for MongoDB as of 1.7.0.
retryer.minRetryDelay¶
- type:
time.Duration
- required:
NO
- default:
30
The minimum time (in ms) to wait till the next retry. Available in Percona Backup for MongoDB as of 1.7.0.
retryer.maxRetryDelay¶
- type:
time.Duration
- required:
NO
- default:
5
The maximum time (in minutes) to wait till the next retry. Available in Percona Backup for MongoDB as of 1.7.0.
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>
compression: <string>
compressionLevel: <int>
pitr.enabled¶
- type:
boolean
- default:
False
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.
pitr.compression¶
- type:
string
- default:
s2
The compression method for Point-in-Time Recovery oplog slices. Available in Percona Backup for MongoDB as of version 1.7.0.
Supported values: gzip
, snappy
, lz4
, s2
, pgzip
, zstd
. Default: s2
.
pitr.compressionLevel¶
- type:
int
The compression level is from 0
till 10
. Default value depends on the compression method used.
Note that the higher value you specify, the more time and computing resources it will take to compress / retrieve the data.
pitr.oplogOnly¶
- type:
boolean
- default:
False
- required:
NO
Controls whether the base backup is required to start Point-in-Time Recovery recovery oplog slicing. When set to true, Percona Backup for MongoDB saves oplog chunks without the base backup snapshot. Available in Percona Backup for MongoDB starting with version 1.8.0. To learn more about the usage, see Point-in-Time Recovery oplog replay.
Backup options¶
backup:
priority:
"localhost:28019": 2.5
"localhost:27018": 2.5
"localhost:27020": 2.0
"localhost:27017": 0.1
compression: <string>
compressionLevel: <int>
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.
backup.compression¶
- type:
string
- default:
s2
The compression method for backup snapshots. Available in Percona Backup for MongoDB as of version 1.8.0.
When none
is specified, backups are made without compression.
Supported values: gzip
, snappy
, lz4
, s2
, pgzip
, zstd
. Default: s2
.
backup.compressionLevel¶
- type:
int
The compression level from 0
till 10
. Default value depends on the compression method used.
Note that the higher value you specify, the more time and computing resources it will take to compress / retrieve the data.
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.