Veritas NetBackup™ for MongoDB Administrator's Guide

Last Published:
Product(s): NetBackup (, 9.0)
  1. Overview of protecting MongoDB using NetBackup
      About protecting a sharded, replica set, or standalone MongoDB cluster using NetBackup
      Protecting MongoDB data using NetBackup
      NetBackup for MongoDB terminologies
      Prerequisites and the best practices for protecting MongoDB
  2. Verify the pre-requisites for the MongoDB plug-in for NetBackup
      Operating system and platform compatibility
      Prerequisites for configuring the MongoDB plug-in
  3. Configuring NetBackup for MongoDB
      About the MongoDB configuration tool
      Prerequisites for manually creating the mongodb.conf file
    3. Configuring backup options for MongoDB using the mongodb.conf file
        Whitelisting the configuration file path on NetBackup master server
      Obtaining the RSA key of the MongoDB nodes
    5. Adding MongoDB credentials in NetBackup
        About the credential configuration file
        How to add the MongoDB credentials in NetBackup
        About the MongoDB roles for protecting the data
      Using a non-root user as a host user
    7. Managing backup hosts
        Whitelisting a NetBackup client on NetBackup master server
  4. Backing up MongoDB using NetBackup
    1. Backing up MongoDB data
        Backing up a MongoDB cluster
      Prerequisites for backing up a MongoDB cluster
    3. Configuring NetBackup policies for MongoDB plug-in
        Creating a BigData backup policy
        Creating BigData policy using the NetBackup Administration Console
        Using the Policy Configuration Wizard to create a BigData policy for MongoDB clusters
        Using the NetBackup Policies utility to create a BigData policy for MongoDB clusters
        Using NetBackup Command Line Interface (CLI) to create a BigData policy for MongoDB clusters
  5. Restoring or recovering MongoDB data using NetBackup
      Restoring MongoDB data
      Prerequisites for MongoDB restore and recovery
    3. About the restore scenarios for MongoDB database from the BAR interface
        High-level steps involved in the Restore and Recovery process
      Using the BAR interface to restore the MongoDB data on the same cluster
      Using the BAR interface to restore the MongoDB data on an alternate cluster
      About restoring MongoDB data in a high availability setup on an alternate client
    7. Recovering a MongoDB database using the command line
        Creating or modifying the rename file
        Using the command line to recover a MongoDB database
      Manual steps after the recovery process
  6. Troubleshooting
      About NetBackup for MongoDB debug logging
      Known limitations for MongoDB protection using NetBackup
  7. Appendix A. Additional information
      Sample MongodB configuration utility workflow to add and update MongodB credentials

Configuring backup options for MongoDB using the mongodb.conf file


If you use the MongoDB configuration tool, these manual steps are not required.

NetBackup uses the default options to back up MongoDB data. To specify custom options to use during a backup operation, you must create a mongodb.conf file in the /usr/openv/var/global/ directory on a UNIX and <Install_Dir>\NetBackup\var\global\ on a Windows master server.


The file name mongodb.conf is case-sensitive.

It is not mandatory to specify all the options in the mongodb.conf file. NetBackup uses the default values for the options that do not have custom values.

Ensure that the mongodb.conf file uses JSON format and whitelist the file path in bp.conf using the BPCD_WHITELIST_PATH option. For more information, See Whitelisting the configuration file path on NetBackup master server.

Backup options in the mongodb.conf file

You can specify the following backup options and their values in the mongodb.conf file:


The options in the file are case-sensitive.




Fully Qualified Domain Name (FQDN), or hostname, or short name and the port number of the primary configuration server and mongod and mongos port in the following format:


Ensure that application_server matches with the hostname value that is used in the MongoDB environment and verified using the db.hostInfo() command.

For example, the hostname value that is displayed by db.hostInfo():

"hostname" : "<hostname_value>:<port>"


Do not enter the node that acts an Arbiter node for MongoDB.


Fully Qualified Domain Name (FQDN), or hostname, or short name and the port number of the secondary or the alternate configuration server. You can add only one alternate configuration server for one cluster.

Use the following format for the value:


Ensure that alternate_config_server matches with the hostname value that is used in the MongoDB environment and verified using the db.hostInfo() command.

For example, the hostname value that is displayed by db.hostInfo():

"hostname" : "<hostname_value>:<port>"

If a connection to the primary configuration server fails, the first, active alternate configuration server is used.

For sharded MongoDB clusters, both the mongod and mongos processes must be running on the alternate config server.

You must enter the value of the alternate_config_server separately for every application_servers entry.


Specify the time in minutes to clean up the stale snapshots or oplogstore that are created because of canceled jobs.

The value must be an integer.


Specifies the percentage of the free space on a volume group that can be used to create a snapshot. This option is used only in case of full backups.

The default value (if not specified) is 20%. The value must be between 0 and 100. Do not use the percentage symbol (%).

For example, run the vgdisplay command to verify the value for the "Free PE / Size" field. The free_space_percentage_snapshot value is the percentage of Free PE / Size of the volume group where the data path resides.

Adjust the free_space_percentage_snapshot value based on the data change rate of the MongoDB instance during the backup operation and the free space that is available on the volume group.

For example, when:

  • Data change rate is 250 MB

  • Volume group has 1 GB Free PE / Size

  • The data change rate is 25% of Free PE / Size

Then specify the minimum value of free_space_percentage_snapshot as 25%.

Keeping the free space snapshot percentage value too low can result in snapshot (and subsequent backup) failure.

Keeping the free space snapshot percentage value too high can reduce the amount of available space on the volume group.

For more information and standard practices, refer to the Linux man page for the lvcreate command.


Use this parameter to disable or enable the data channel encryption between the MongoDB cluster and the backup host.

For example, use "data_channel_tls": false to disable the data channel encryption.

By default, all the traffic between the NetBackup backup host and the thin client (mdbserver) is over a TLS channel. You can disable this TLS for data movement from thin client (mdbserver) to the backup host to improve the performance.


Control data and sensitive data such as credentials are still transferred over the TLS channel when this option is disabled.


Location where the thin client (mdbserver) logs are generated on the MongoDB nodes.

Default location is /tmp. If the directory path is mentioned, but the directory does not exist on the server, NetBackup creates a directory.


Specify the logging level.

Default value is 3.

Refer to the following options for logging level values:

  • ESERROR = 1

  • ESWARN = 2

  • ESINFO = 3

  • ESDEBUG = 4

  • ESTRACE = 5



Specify the maximum file size in MB for the NetBackup thin client log file.

The default size is 10 MB. A new log file is created every day or if the existing log file exceeds the maximum size. The log file creation does not affect an ongoing job and the log roll-over happens during the next job that is performed by mdbserver.

The logs are cleaned up after 30 days.



This parameter is applicable only for sharded MongoDB clusters.

Defines the number of parallel data streams per backup host. The minimum value is 32.

If max_streams is not defined, the default value is 32 parallel data streams per backup host.

Add the following entry to the mongodb.conf file:



  • global_default

    Default upper limit of the parallel data streams for all the backup hosts.

  • backup_host

    Set the upper limit of the parallel data streams for a specified backup host.

    The backup_host must be the same that is specified in the backup policy. If you have multiple backup hosts, the entry can be repeated for all backup hosts. If you do not specify a backup host, the global_default value is used.


This option sets the upper limit on the number of parallel data streams per backup host. The backup or the recovery job might not use all the available streams.


Lets you print the progress logging information about the files that are restored to the activity monitor.

Default value is 0 (off).

To enable set "mdb_progress_loglevel": 1.


Enabling this option can increase the recovery time.


Specify a location to copy the thin client (mdbserver) binaries on the MongoDB nodes that are required for the MongoDB backup and restore operation.

The files are copied to the servers that contain the data that needs to be protected and are removed once the backup operation completes.

Default location to copy the files is /tmp.


Do not specify the mount path or the high-level Linux directories because that can cause conflicts in directory permissions. For example, avoid specifying the path as /root, /etc, /usr, /bin, /home, etc.


Port that is used by the backup host to connect with the NetBackup thin client (mdbserver) that is running on the MongoDB node.

Default value is "11000".

This value is a string.


Use this parameter when multiple mongod instances are running on a single MongoDB node.

This option lets you use the next available port within the range for the backup and restore operation if the existing port is in use.

This option lets you run multiple backup jobs simultaneously on different ports by deploying multiple NetBackup thin clients (mdbserver).

Enter the value as "mdbserver_port_range":range_value, where the range_value is an integer to define the range of port numbers that can be used. For example, if you add the range_value as 10 and the mdbserver_port is defined 12000, the port range is used from 12000 to 12009.

The default value is 10.

Change this value based on the number of mongod instances on a MongoDB host that are backed up simultaneously.


Defines the time in minutes to wait before a NetBackup thin client (mdbserver) process is killed.

The default value is 300 (minutes).

Set the value higher than 300 minutes if your backup window requires more time.

Ideally, mdbserver is killed after the plug-in terminates or the backup is complete.


Port that the mongos process uses for communication.

This is a mandatory parameter for sharded MongoDB clusters.

You must specify this value for each of the application_servers or alternate_config_server entry

This value is a string.


For differential incremental backups, specify a custom directory to store the MongoDB oplog file.

The location is stored in the backup image.

Default location is /tmp/oplogstore.

Ensure that there is enough free space at this location for the oplog data of the incremental backups.


Specify the path on the MongoDB nodes for mounting LVM snapshots during full backups.

Default path is /tmp.


Ensure that the HostUser that you have configured in the MongoDB credential file has the read and write permissions to all the paths mentioned in the mongodb.conf file.

If you do not add all the options, an entry is added in the logs about the missing options. The default values are used for the options that are not mentioned and the backup operation proceeds.

Sample of the mongodb.conf file contents
  "application_servers": {
    "FQDN_primary_configuration_server_1:port": {
      "alternate_config_server": [
          "hostname:port": "FQDN_alternate_configuration_server_1:26051",
          "mongos_port": "26051"
      "mongos_port": "26052"
    "FQDN_primary_configuration_server_2:port": {
      "alternate_config_server": [
          "hostname:port": "FQDN_alternate_configuration_server_2:26053",
          "mongos_port": "26053"
      "mongos_port": "26054"
  "mdbserver_location": "/path/to/store/mdbserver/",
  "logdir": "/path/to/store/logdir/",
  "mdbserver_port": "21020",
  "loglevel": 5,
  "max_log_mbsize": 4,
  "oplog_location": "/path/to/store/oplog/",
  "free_space_percentage_snapshot": "25",
  "mdb_progress_loglevel": 1,
  "snapshot_mount_path": "/path/to/mount/snapshot/",