NetBackup10 AdminGuide MongoDB
NetBackup10 AdminGuide MongoDB
Administrator's Guide
Release 10.0
NetBackup™ for MongoDB Administrator's Guide
Last updated: 2022-03-08
Legal Notice
Copyright © 2022 Veritas Technologies LLC. All rights reserved.
Veritas, the Veritas Logo, and NetBackup are trademarks or registered trademarks of Veritas
Technologies LLC or its affiliates in the U.S. and other countries. Other names may be
trademarks of their respective owners.
This product may contain third-party software for which Veritas is required to provide attribution
to the third party (“Third-party Programs”). Some of the Third-party Programs are available
under open source or free software licenses. The License Agreement accompanying the
Software does not alter any rights or obligations you may have under those open source or
free software licenses. Refer to the Third-party Legal Notices document accompanying this
Veritas product or available at:
https://www.veritas.com/about/legal/license-agreements
The product described in this document is distributed under licenses restricting its use, copying,
distribution, and decompilation/reverse engineering. No part of this document may be
reproduced in any form by any means without prior written authorization of Veritas Technologies
LLC and its licensors, if any.
The Licensed Software and Documentation are deemed to be commercial computer software
as defined in FAR 12.212 and subject to restricted rights as defined in FAR Section 52.227-19
"Commercial Computer Software - Restricted Rights" and DFARS 227.7202, et seq.
"Commercial Computer Software and Commercial Computer Software Documentation," as
applicable, and any successor regulations, whether delivered by Veritas as on premises or
hosted services. Any use, modification, reproduction release, performance, display or disclosure
of the Licensed Software and Documentation by the U.S. Government shall be solely in
accordance with the terms of this Agreement.
http://www.veritas.com
Technical Support
Technical Support maintains support centers globally. All support services will be delivered
in accordance with your support agreement and the then-current enterprise technical support
policies. For information about our support offerings and how to contact Technical Support,
visit our website:
https://www.veritas.com/support
You can manage your Veritas account information at the following URL:
https://my.veritas.com
If you have questions regarding an existing support agreement, please email the support
agreement administration team for your region as follows:
Japan [email protected]
Documentation
Make sure that you have the current version of the documentation. Each document displays
the date of the last update on page 2. The latest documentation is available on the Veritas
website:
https://sort.veritas.com/documents
Documentation feedback
Your feedback is important to us. Suggest improvements or report errors or omissions to the
documentation. Include the document title, document version, chapter title, and section title
of the text on which you are reporting. Send feedback to:
You can also see documentation information or ask a question on the Veritas community site:
http://www.veritas.com/community/
https://sort.veritas.com/data/support/SORT_Data_Sheet.pdf
Contents
Index .................................................................................................................... 88
Chapter 1
Overview of protecting
MongoDB using
NetBackup
This chapter includes the following topics:
■ Limitations
Run the
Verify pre- Whitelist the
MongoDB Run Backup and
requisites for the required paths
configuration Recovery
MongoDB plug-in and hosts
utility
Manually create:
- MongoDB credentials file
- Backup parameters file
Use NetBackup to protect MongoDB On a very high level, to protect MongoDB, you need:
Refer to the NetBackup compatibility lists for the supported master and
media server configurations. The backup host (NetBackup media server
or a NetBackup client) is supported only on an RHEL or a SUSE host.
Verify the pre-requisites for the MongoDB Refer to the following topics before you use the plug-in:
plug-in
■ See “Operating system and platform compatibility” on page 20.
■ See “Prerequisites for configuring the MongoDB plug-in” on page 20.
Run the MongoDB configuration tool Run MongoDB configuration tool to generate the following files
automatically:
You can access the MongoDB configuration tool using the tpconfig
command line on the NetBackup master server. The path to access
the tpconfig command is /usr/openv/volmgr/bin/ for UNIX
and <install_path>\Volmgr\bin\ for Windows.
Configure the MongoDB plug-in and the Create a mongodb.conf file to configure backup options in NetBackup:
communication between NetBackup and
■ See “Prerequisites for manually creating the mongodb.conf file”
MongoDB
on page 24.
Note: If you use the MongoDB configuration ■ See “Configuring backup options for MongoDB using the
tool, a few these configuration steps are not mongodb.conf file ” on page 25.
required. ■ See “Including the configuration file path on NetBackup master
server allowed list” on page 32.
Note: If you use the MongoDB configuration tool, these steps are
not required.
Get the RSA key of the MongoDB node for adding MongoDB credentials
to NetBackup:
■ See “Obtaining the RSA key of the MongoDB nodes” on page 33.
Note: If you use the MongoDB configuration tool, these steps are
not required.
■ See “About the MongoDB roles for protecting the data” on page 38.
To use a non-root user or a user without root permissions as a host
user:
Restore and recover the MongoDB database Overview of the restore and the recovery process:
■ See “About the restore scenarios for MongoDB database from the
BAR interface” on page 55.
■ See “High-level steps involved in the Restore and Recovery process”
on page 57.
SSH communication
BigData policy
Config server 1
Application_Type=mongodb
Primary server 1 Backup Host 1
Master server
Secondary server 1
Backup Host 2
Config server n
Media server
Primary server n Storage
Backup Host n
Secondary server n Parallel Streams MongoDB plug-in is deployed
MongoDB cluster on all the backup hosts
...
Terminology Definition
■ The backup job runs a discovery job for getting information of the data to be backed
up.
■ Child jobs are created for each backup host that performs the actual data transfer.
■ After the backup is complete, the job cleans up the snapshots on the backup nodes,
removes the thin client and is marked complete.
Discovery job When a backup job is executed, first a discovery job is created. The discovery job
communicates with the config server and gathers information of the shards that need to
be backed up and the associated nodes.
At the end of the discovery, the job populates a workload discovery file that NetBackup
then uses to distribute the workload amongst the backup hosts.
Child job For backup, a separate child job is created for each backup host to transfer data to the
storage media. A child job can transfer data blocks from multiple secondary nodes.
Workload discovery file During discovery, when the backup host communicates with the config server, a workload
discovery file is created. The file contains information about the data files to be backed
up and the associated data nodes.
Workload distribution file After the discovery is complete, NetBackup creates a workload distribution file for each
backup host. These files contain information of the data that is backed up by the respective
backup host.
Overview of protecting MongoDB using NetBackup 15
Limitations
Terminology Definition
Parallel streams The NetBackup parallel streaming framework allows data blocks from multiple secondary
nodes to be backed up using multiple backup hosts simultaneously.
Backup host The backup host acts as a proxy client. All the backup and the restore operations are
executed through the backup host.
You can configure media servers, clients, or a master server as a backup host.
Primary config server In a high-availability scenario, the primary config server is the MongoDB instance running
in a primary role on a config server replica set. The primary config server must have at
least one associated mongos service running on the same host.
Fail-over config server In a high-availability scenario, the config server other than the primary config server that
is specified as alternate_config_server in the mongodb.conf file is referred as
the fail-over config server.
Limitations
Consider the following limitations before you deploy the MongoDB plug-in:
■ For highly available MongoDB cluster, if fail-over happens during a backup, then
the job fails.
■ IP address is not supported for the application server and backup host field.
You must enter the FQDN, host name, or the short name of the application
server or the backup host.
■ Encrypted MongoDB environments are not supported.
Overview of protecting MongoDB using NetBackup 16
Prerequisites and the best practices for protecting MongoDB
■ NetBackup supports the following file systems for backup and restore:
■ XFS
■ ext4
■ Install OpenSSH packages on all the MongoDB nodes. Enable SSH on all the
MongoDB nodes.
■ NetBackup supports the MongoDB clusters that are configured with the
WiredTiger storage engine.
■ NetBackup protects the MongoDB clusters that are configured or installed locally
using the .tar files or installed using the MongoDB official repositories.
■ NetBackup supports the Differential Incremental backup for MongoDB along
with a Full Backup. Cumulative Incremental backups are not supported currently.
■ NetBackup recommends that you have at least three configuration servers in
your sharded MongoDB environment to support high availability of the backups.
■ Do not install the MongoDB plug-in on a server that also has the MongoDB
application. A server that has the MongoDB application cannot be used as a
backup host.
■ Ensure that the local time on the MongoDB server and the backup host are
synchronized with the NTP server.
■ For sharded MongoDB clusters, the query router role must be present on the
config server.
■ For the MongoDB cluster that has a SUSE operating system, on all the MongoDB
nodes set the PasswordAuthentication field to Yes in the
/etc/ssh/sshd_config file.
After you update the file, restart sshd.
Ensure that all the clusters support the same hash key algorithm (RSA).
■ Ensure that the host user credentials that are configured using the tpconfig
command are of the host user account that is used to configure the MongoDB
cluster (MongoDB daemon's host user account that is either root or non-root).
For more details, See “Using a non-root user as a host user” on page 38.
Overview of protecting MongoDB using NetBackup 18
Prerequisites and the best practices for protecting MongoDB
■ To protect MongoDB version 4.2, upgrade the NetBackup backup hosts that
you have defined in the backup policy to version 9.0 along with NetBackup
master and media server. Backup host versions earlier than 9.0 can affect the
MongoDB 4.2 cluster.
■ Ensure that the ss command is available on the MongoDB nodes. The ss
command is required to identify the MongoDB clusters that are created using
an externally sourced configuration file.
■ To protect MongoDB version 4.2, upgrade the NetBackup backup hosts that
you have defined in the backup policy to version 9.0 along with NetBackup
master and media server. Backup host versions earlier than 9.0 can affect the
MongoDB 4.2 cluster.
■ If the MongoDB host user does not have root permissions, ensure that the user
has access to all the temporary paths to copy the thin client (mdbserver), logs,
snapshots, etc. Add the non-root user to the sudoers file in the operating system.
■ If you install the MongoDB using the .tar file or to a non-default location, add
the path of the MongoDB bin folder in the bashrc file of the operating system
to ensure that you can run the MongoDB commands from the CLI.
■ If your MongoDB server uses the SUSE 12.3 operating system, ensure that you
can connect to mongod and mongos process with the --host <FQDN> option. For
more information, refer to the MongoDB Administrator's Guide.
■ When you use the -host_password option with the tpconfig command and
mongodb.conf HostPassword, ensure that the password:
■ When you define the paths for logs, thin clients (mdbserver), snapshots, or
anything else in the mongodb.conf file, ensure that the host user in the
credentials file has valid permissions to access these paths.
■ To enable SSH, add the following entry in the sudoers file:
Default <host_user> !requiretty
Overview of protecting MongoDB using NetBackup 19
Prerequisites and the best practices for protecting MongoDB
■ Ensure that there are no JSON format errors or typos in the mongodb.conf file
before you run a backup or restore job.
■ Ensure that the path of the security certificates that are added in the mongod.conf
file and used with the tpconfig command are the same for all the MongoDB
nodes.
■ For simple authentication, configure the same user who is part of the root group
from the admin database for every MongoDB node.
■ If you use the mongod.conf or the mongos.conf file to start the MongoDB
processes, run the mongod file using the absolute system path on the MongoDB
cluster. For example, use the following command:
mongod --config /home/user1/mongod.conf
■ NetBackup recommends that you run a full backup after making any configuration
changes in the MongoDB instance. If an incremental backup is scheduled to
run after you make the configuration changes, then run a full backup manually
before the incremental backup.
For examples, when you modify the MongoDB Feature Compatibility Version
(FCV), MongoDB version, authentication type, topology (addition of new shards
or removal of existing shards), storage parameters, etc. then run a full backup.
Chapter 2
Verify the pre-requisites
for the MongoDB plug-in
for NetBackup
This chapter includes the following topics:
Note: The version number must be the same as the backup host.
Verify the pre-requisites for the MongoDB plug-in for NetBackup 21
Prerequisites for configuring the MongoDB plug-in
To add the package, run the nbrepo command on the NetBackup primary server:
./nbrepo -add vxupdate_nb_version_suse_x64.sja
./nbrepo -add vxupdate_nb_version_redhat_x64.sja
For a MongoDB host with CentOS operating system, add the Linux RHEL
VxUpdate package of the NetBackup version of the backup host in the package
repository on the NetBackup primary server.
Note: If the package is not added, the MongoDB backups can fail with error -
6729: "Unable to download the thin client from the package repository."
■ Use consistent conventions for host names of backup hosts, media servers,
and primary server. For example, if you are using the host name as
MongoDB.veritas.com (FQDN format) use the same everywhere, specially
while running the tpconfig command.
■ Ensure that the backup host can communicate with all the MongoDB nodes.
■ Ensure that the bindIp setting in the configuration file of mongod instance on
the MongoDB hosts has value 0.0.0.0.
Best practices:
■ Add the entries of all the nodes of the MongoDB cluster to the/etc/hosts file
on all the backup hosts. You must add the host name in FQDN format.
Or
Add the appropriate DNS entries in the /etc/resolv.conf file.
Chapter 3
Configuring NetBackup for
MongoDB
This chapter includes the following topics:
■ The MongoDB configuration file that configures the global NetBackup parameters
for the MongoDB cluster.
For more information about the MongoDB configuration file and the manual
method to create it, refer to the following topic:
See “Configuring backup options for MongoDB using the mongodb.conf file ”
on page 25.
Note: You can create the two files manually, but you must ensure that the formatting
and the parameters are correct.
You can access the MongoDB configuration tool using the tpconfig command line
on the NetBackup master server. The path to access the tpconfig command is
/usr/openv/volmgr/bin/.
■ On a Linux and Solaris master server, run ./tpconfig and tpconfig and select
the fourth option for MongoDB configuration.
See “Sample MongodB configuration utility workflow to add and update MongodB
credentials” on page 83.
For more information about the tpconfig command, refer to the NetBackup
Commands Reference Guide.
Whitelist the mongodb.conf file path in bp.conf using the bpcd_allowed_path
option. For more information, See “Including the configuration file path on NetBackup
master server allowed list” on page 32.
Note: If you are using the credentials file, you can manually update the file and
upload the file using the tpconfig command.
■ If you do not specify any values in the mongodb.conf file for MongoDB cluster
ports and paths to deploy the thin clients, create snapshots, or logs, the default
values are considered.
■ The minimum value of the max_streams field is 32. If max_streams is not defined,
the default value is 32 parallel data streams per backup host.
For the max_streams field in the mongodb.conf file, the value of the backup host
takes priority over the global_default value.
For example, the value 32 takes priority over the value 34 and the job runs 32
streams during a backup in this scenario:
"max_streams": {
"global_default": 34,
"Backup_Host":32}
The backup streams are distributed across the backup hosts as defined in the
backup policy and not as per the backup hosts that are defined in the
max_streams option in the mongodb.conf file.
■ For a sharded MongoDB environment, ensure that the mongodb.conf file has
the latest primary config server and secondary config server.
Configuring NetBackup for MongoDB 25
Configuring backup options for MongoDB using the mongodb.conf file
■ Ensure that the folders or directories that are mentioned in the mongodb.conf
file are available on the MongoDB cluster. For example, the folders or directories
for snapshot_mount_path, oplog_location, logdir, etc.
■ Give the host user access to the port and the port range that is specified in the
mongodb.conf file.
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.
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_allowed_path option. For more information, See “Including
the configuration file path on NetBackup master server allowed list” on page 32.
Options Details
clientFQDN_OR_hostname_OR_shortname:portnumber
"hostname" : "<hostname_value>:<port>"
Warning: Do not enter the node that acts an Arbiter node for
MongoDB.
clientFQDN_OR_hostname_OR_shortname:portnumber
"hostname" : "<hostname_value>:<port>"
Options Details
free_space_percentage_snapshot 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.
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.
data_channel_tls Use this parameter to disable or enable the data channel encryption
between the MongoDB cluster and the backup host.
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.
Note: Control data and sensitive data such as credentials are still
transferred over the TLS channel when this option is disabled.
Configuring NetBackup for MongoDB 28
Configuring backup options for MongoDB using the mongodb.conf file
Options Details
logdir 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.
Default value is 3.
■ ESERROR = 1
■ ESWARN = 2
■ ESINFO = 3
■ ESDEBUG = 4
■ ESTRACE = 5
■ ESCRITICAL = 6
max_log_mbsize 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.
Options Details
max_streams
Note: This parameter is applicable only for sharded MongoDB
clusters.
Defines the number of parallel data streams per backup host. The
minimum value is 32.
max_streams:
{
"global_default":<set_value>,
"<backup_host>":<set_value>
}
Where:
■ 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.
Note: 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.
mdb_progress_loglevel Lets you print the progress logging information about the files that
are restored to the activity monitor.
Options Details
mdbserver_port Port that is used by the backup host to connect with the NetBackup
thin client (mdbserver) that is running on the MongoDB node.
mdbserver_port_range 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.
Options Details
mdbserver_timeout_min Defines the time in minutes to wait before a NetBackup thin client
(mdbserver) process is killed.
Set the value higher than 300 minutes if your backup window requires
more time.
Ensure that there is enough free space at this location for the oplog
data of the incremental backups.
snapshot_mount_path Specify the path on the MongoDB nodes for mounting LVM snapshots
during full backups.
Note: 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.
{
"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/",
"max_streams":
{
"global_default":2,
"FQDN_backup_host_1":1
}
}
bpsetconfig -h masterserver_name
bpsetconfig bpcd_allowed_path = /usr/openv/var/global/
bpsetconfig -h masterserver_name
bpsetconfig bpcd_allowed_path = <install_dir>\NetBackup\var\global\
cat /etc/ssh/ssh_host_rsa_key.pub |awk '{print $2}' |base64 -d |sha256sum |awk '{print $1}'
cat /etc/ssh/ssh_host_rsa_key.pub |awk '{print $2}' |base64 -d |sha256sum |awk '{print $1}'
Command output:
b2352722053ac9f40bc1XXXXXXXXXXXXXXXXXXXXXXXXX419fa241ba9431fd6b9
Copy the RSA fingerprint. You need to provide this fingerprint when you add the
MongoDB credentials.
Configuring NetBackup for MongoDB 34
Adding MongoDB credentials in NetBackup
Add the credentials of the MongoDB node using the tpconfig command for the
application server that is specified in the Clients tab in the backup policy.
Multiple MongoDB nodes must be separated using a comma.
■ For sharded MongoDB cluster, add all the mongod and mongos ports in the
following format:
mongod_hostname:mongod_port
mongos_hostname:mongos_port
■ For replica set MongoDB cluster and standalone MongoDB cluster, add the
mongod port in the following format:
mongod_hostname:mongod_port
Refer to the following sample credential file that contains all the authentication
types:
■ No Authentication
{
"app.server.com:26050" : {
"AuthType":"NOAUTH",
"HostUser":"root",
"HostPassword":"password”,
"HostRsaKey":"b2352722053ac9f40bc1XXXXXXXXXXXXXXXXXXXXXXXXX419fa241ba9431fd6b9"
}
}
■ Simple Authentication
{
"app3.server.com:26051" : {
"AuthType":"SIMPLEAUTH",
"HostUser":"root",
"HostPassword":"password",
"HostRsaKey":"b2352722053ac9f40bc1XXXXXXXXXXXXXXXXXXXXXXXXX419fa241ba9431fd6b9",
"AppUserId":"admin",
"AppUserPassword":"password"
}
}
■ Certificate-based authentication
Configuring NetBackup for MongoDB 37
Adding MongoDB credentials in NetBackup
{
"app4.server.com:26052" : {
"AuthType":"CERTAUTH",
"HostUser":"root",
"HostPassword":"password",
"HostRsaKey":"b2352722053ac9f40bc1XXXXXXXXXXXXXXXXXXXXXXXXX419fa241ba9431fd6b9",
"ServerPemPath":"/root/certs/user1.pem",
"CAPemPath":"/root/certs/mongo-CA-cert.crt",
"Passkey":"password",
"CADir":"/root/",
"CARole":"root",
"CertificateUser":"CN=user1,OU=nbu,O=vtas,L=pune,ST=mh,C=in"
}
}
Where:
application_server is mongodb_hostname-mongodport
Note: Ensure that the same user is added for all the MongoDB nodes.
■ Ensure that the host user credentials that are configured using the tpconfig
command are of the host user account that is used to configure the MongoDB
cluster (MongoDB daemon's host user account).
■ Give that host user the ownership rights to all the directories that you have
mentioned in the mongodb.conf file. This step ensures that the backup host can
access the directories to copy the required files for backup operations. For
example, the user needs rights to mdbserver_location, logdir,
oplog_location.
■ Ensure that the host user has ownership of the MongoDB database path and
its contents. This ownership is required for the backup as well as restore
operations.
■ On the server where MongoDB is installed, add the host user in the sudoers
file.
■ NetBackup does not support service ids like mongod as a host user id.
For UNIX:
bpplinclude PolicyName -add "Backup_Host=FQDN_or_hostname"
For more information about the bpplinclude command, refer to the NetBackup
Commands Reference Guide.
For more information, See “Using NetBackup Command Line Interface (CLI)
to create a BigData policy for MongoDB clusters ” on page 48.
To remove a backup host
1 In the Backup Selections tab, select the backup host that you want to remove.
2 Right click the selected backup host and click Delete.
Alternatively, you can also remove a backup host using the following command:
For Windows:
bpplinclude PolicyName -delete "Backup_Host=FQDN_or_hostname"
For UNIX:
bpplinclude PolicyName -delete "Backup_Host=FQDN_or_hostname"
For more information about the bpplinclude command, refer to the NetBackup
Commands Reference Guide.
■ For Windows
bpsetconfig -h masterserver
bpsetconfig> APP_PROXY_SERVER = clientname1.domain.org
bpsetconfig> APP_PROXY_SERVER = clientname2.domain.org
bpsetconfig>
Windows systems: <ctl+Z>
For more information about the bpsetconfig command, refer to the NetBackup
Commands Reference Guide.
This command sets the APP_PROXY_SERVER = clientname entry in the backup
configuration (bp.conf) file.
For more information about the APP_PROXY_SERVER = clientname, refer to the
Configuration options for NetBackup clients section in NetBackup Administrator's
Guide, Volume I
Chapter 4
Backing up MongoDB
using NetBackup
This chapter includes the following topics:
Secondary node 1
6 Shard 1
Database paths (Replica set 1)
are discovered
Backup host 2
dynamically
Primary node 2
7
Secondary nodes Secondary node 2
are quiesced and Shard 2
snapshots (full (Replica set 2) 8 Data is backed up in Backup host 3
parallel streams
backup) or oplog
dumps (incremental)
are taken Primary node 3 Storage
Secondary node 3
Shard 3
(Replica set 3)
MongoDB cluster
5. The thin client discovers the database paths dynamically, quiesces the
secondary nodes, and takes snapshots for full backups and captures oplog
for incremental backups.
6. Individual child jobs run for each backup stream and data is backed up.
7. Data blocks are streamed simultaneously from different secondary nodes to
multiple backup hosts.
Once the backup operation is completed, the thin client is removed from the servers.
The compound backup job is not completed until all the child jobs are completed.
After the child jobs are completed, NetBackup cleans all the snapshots from the
secondary nodes. Only after the cleanup activity is completed, the compound backup
job is completed.
■ Renaming the volume group or the physical and logical volumes of the LVM for
MongoDB database paths causes the backup to fail. If you rename the volume
group or the physical and logical volumes of the LVM, ensure that the MongoDB
database is mounted on the new path before taking a backup.
■ The backup shuts down the balancer on the mongos process and blocks all the
other operations. Hence, during a backup process, ensure that you do not run
any other operation that uses the mongos process. For example, import the
database.
■ Always run a full backup when you make change to the database path, or modify
the configuration file for the mongod or the mongos processes, or change the
MongoDB topology.
■ If there are multiple MongoDB clients in a single Netbackup backup policy
increase the Client read timeout parameter for master server, media server,
and the client to ensure that the all the backups are successful.
For more information, refer to the NetBackup™ Administrator's Guide, Volume
I and the Timeouts properties section.
■ Incremental backup jobs use consistent backup images as a reference for
determining the incremental changes. If the previous backup has failed, or was
partially successful (failed for one of the nodes), it is skipped completely and a
backup image prior to that is considered. In such cases, the backup operation
can take longer and the image that is created might be of a larger size.
■ The oplog file has a capped or rolling cache and you can configure the size of
the file. NetBackup uses oplog to capture incremental data. Oplog roll-over can
cause the incremental backups to fail. To prevent this, make sure that oplog
file size is sufficient to hold the incremental data that is generated between the
incremental backups.
■ Ensure that the user that you have added using the tpconfig command has
access to the entire MongoDB cluster and the custom folder paths that are
specified in the mongodb.conf file.
■ For MongoDB 4.2 sharded clusters, ensure that the Feature Compatibility Version
(FCV) is same across all the MongoDB cluster nodes. This step ensures data
consistency during backups.
■ If you are using oplog retention feature on replica set, ensure that the scheduled
time between incremental backups is less than the minimum oplog retention
period. This ensures capturing the correct incremental backup.
■ NetBackup supports incremental backups for MongoDB 4.2 sharded clusters
only if the Feature Compatibility Version (FCV) is set to 4.0 or earlier. If your
MongoDB 4.2 sharded cluster has FCV 4.2, then only full backups are supported.
Backing up MongoDB using NetBackup 46
Configuring NetBackup policies for MongoDB plug-in
■ NetBackup supports full backup only for mongodb 4.4 version on sharded cluster.
Warning: Do not enter the node that acts an Arbiter node for MongoDB.
8 On the Backup Selections tab, enter the following parameters and their values
as shown:
■ Application_Type=mongodb
The parameter values are case-sensitive.
■ Backup_Host=FQDN or hostname
The backup host must have a Linux operating system. The backup host
can be a NetBackup client or a media server.
You can specify multiple backup hosts.
■ Manually add the ALL_DATABASES directive.
4 View the details about the new policy using the -L option.
bpplinfo policyname -L
7 Specify the backup host on which you want the backup operations to be
performed for MongoDB.
bpplinclude PolicyName -add "Backup_Host=IP_address or hostname"
Note: The backup host must have a Linux operating system. The backup host
can be a NetBackup client or a media server or a master server.
8 Specify the MongoDB directory or folder name that you want to backup.
bpplinclude PolicyName -add "ALL_DATABASES"
9 Modify and update the policy storage type for BigData policy.
bpplinfo PolicyName -residence STUName -modify
The client name as seen in the MongoDB shell and the mongod port number
of the primary node of the replica set in the following format:
MongoDBNode-portnumber
Warning: Do not enter the node that acts an Arbiter node for MongoDB.
11 Assign a schedule for the created BigData policy as per your requirements.
bpplsched PolicyName -add Schedule_Name -cal 0 -rl 0 -st
sched_type -window 0 0
■ About the restore scenarios for MongoDB database from the BAR interface
■ 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
2
Backup host connects
with config server
Config server
1 Master server
Restore job
is triggered
Primary server 1
Backup host
Secondary server 1 4
Storage
Objects are restored
MongoDB cluster
3
Restore
Starts
■ Ensure that the user that you configure using the tpconfig command for
restoring the MongoDB data has read, write, and execute permissions for all
the files and subfolders on the target MongoDB directory. NetBackup uses this
user account to recover and run the MongoDB instance.
■ Before you restore the MongoDB data to an alternate cluster, ensure that you
add the alternate MongoDB cluster credentials in the source cluster credentials
file.
Restoring or recovering MongoDB data using NetBackup 53
Prerequisites for MongoDB restore and recovery
■ The path to the .pid files must be available on the destination MongoDB cluster
to ensure that the recovery operation is successful.
Restoring or recovering MongoDB data using NetBackup 54
Prerequisites for MongoDB restore and recovery
■ In case of a scenario where multiple MongoDB clusters are running on the same
server and are backed up using the same or different backup policies, ensure
that you select the correct application server that you want to restore.
For example, if there are multiple clusters with the following configuration:
Replica1
Primary: host1:26050
Secondary: host1:26060
Replica2
Primary: host1:26055
Secondary: host1:26066
And you want to recover Replica1, ensure that you specify correct application
server and its port (host1-26050) as the source client in the BAR UI.
■ Before you start a recovery operation, ensure that stale mdbserver (thin client)
processes are not running on your MongoDB instance at the following path:
/<mdbserver_location>/<Host>-<MongodPort>-<mdbserver_port in
range>/mdbserver
If stale mdbserver processes are running on the MongoDB host for the same
MongoDB instance that you want to recover, the recovery operation is unable
to shutdown the MongoDB instance. This issue causes the recovery job to stop
responding.
■ Restore and recovery of the MongoDB cluster requires the same security mode
that is used at the time of the backup. Ensure that security mode is the same
for the original cluster and the target cluster.
For example, if SSL is used during the backup, then recovery is done using SSL
and the target configuration is changed to SSL. Similarly, if TLS is used during
the backup, then recovery is done using TLS and the target configuration is
changed to TLS.
■ Restore and recovery of the MongoDB cluster requires the same value of the
Feature Compatibility Version (FCV) that is used at the time of the backup.
Ensure that FCV is the same for the original cluster and the target cluster.
For example, if FCV is 4.2 during the backup, then restore uses FCV 4.2 and
the target cluster has FCV 4.2 after the recovery process completes. Similarly,
if FCV is 4.0 during the backup, then restore uses FCV 4.0 and the target cluster
has FCV 4.0 after the recovery process completes.
Restoring or recovering MongoDB data using NetBackup 55
About the restore scenarios for MongoDB database from the BAR interface
Restore destination
The restore destination options are available in the General tab after you enter the
details in the Backup, Archive, and Restore interface and proceed to the Restore
Marked Files dialog box.
Restore everything to its original location. Restore the MongoDB database to the same location or
cluster.
Restore individual directories and files to different Restore the MongoDB database to an different location or
locations. cluster.
Option from the MongoDB tab in the Scenarios to select the restore and recovery options
Restore Marked Files dialog box
Restore and Recover Restores and recovers the entire MongoDB cluster with the following
recovery options:
Restore Only
Warning: Use this option with caution since this may lead to
inconsistent state of the cluster.
Before you use this option, you must shutdown the MongoDB cluster.
Stop the mongos process and then the mongod processes on all the
nodes of the configuration server and shards.
The Recovery Options section is applicable only for the Restore and Recover
option.
■ The target cluster is shutdown and the WiredTigerLogs files that are present
in the journal folder at the database path are removed.
■ Restore
The data moves in parallel streams.
■ Post-restore or recovery
■ The target cluster's configuration parameters along with the configuration
parameters of the source cluster that was backed up are used to start the
MongoDB services.
■ The mongod services are started on each node on a local host in maintenance
mode without enabling the authentication.
The minimum required operations are run in the maintenance mode on the
local host, the service is shutdown and restarted with authentication.
■ Sharding, replication, and authentication is enabled and the MongoDB cluster
is initiated.
■ The oplogs are replayed on the MongoDB cluster nodes.
Note: The restored node is now the primary node in the replica set.
Only the nodes that are backed up and selected for recovery are recovered.
The other cluster members must be added manually to the recovered cluster.
You must select the Overwrite existing files.
■ Specify the MongoDB application server as the source for which you want
to perform the restore operation.
From the Source client for restores list, select the required Application
server.
■ Specify the backup host as the destination client.
From the Destination client for restores list, select the required backup
host. Restore is faster if the backup host is the media server that had backed
up the node.
■ On the Specify NetBackup Machines and Policy Type wizard, enter the
policy type details for restore.
From the Policy type for restores list, choose BigData as the policy type
for restore.
Click Ok.
4 Select the appropriate date range to restore the complete data set.
5 Go to the Backup History and select the backup images that you want to
restore.
6 In the Browse directory, specify the root directory ( “/”) as the path to browse.
In the Directory Structure pane, expand the Directory.
All the subsequent files and folders under the directory are displayed in the
Contents of Selected Directory pane.
7 In the Contents of Selected Directory pane, select the check box for the
MongoDB MongoDB nodes that you want to restore.
8 In the Restore Marked Files dialog box, select the destination for restore as
per your requirement.
■ Select Restore everything to its original location to restore your files to
the same location where you performed your backup.
2. Rename the application server and its nodes and set the value for the alternate
application server.
■ In the BAR UI select the General tab > Restore individual directories
and files to different location and use Change Selected Destination(s)
to add the alternate application server and port.
■ To change the folder path, select Add Destination and add the new
destination path.
See the section called “Alternate restore from a nested database path”
on page 61.
3. Click Start Restore to start the recovery operation. You can check the status
from the Activity Monitor.
■ Specify the source and the destination path for the parent folder:
Source /host:port/usr/mongodb and Destination /host:port/alt-dir/dbpath
■ Specify the source and the destination path for the base parent folder:
Source /host:port/usr and Destination /host:port/alt-dir
Note: When you do an alternate restore to a non-root path, the restore is partially
successful if the database path contains multiple subfolders.
In such a scenario, when you do an alternate restore to a different location, you
must add an entry for each directory level.
For example:
Source:/hostname1:port1/Config_Data
Destination: /hostname2:port3/mongo_inst2
Source:/hostname1:port1/Config_Data/data
Destination:/hostname2:port3/mongo_inst2/data
Source:/hostname2:port2/Shard1_Primary
Destination:/hostname2:port3/mongo_inst2
Source:/hostname2:port2/Shard1_Primary/data
Destination:/hostname2:port3/mongo_inst2/data
from one host and incremental backup is taken from another host in the same shard
or replica set.
During restore, you must redirect the restore of these backup images to the same
MongoDB host.
For example, to restore backups from /host1:port1/dbpath and
/host2:port1/tmp, specify the following:
In the following example, the Source Client that is defined in the backup policy is
endu79-26050, and the backup was done from the MongoDB node endu79-26055.
In this scenario, as part of restore and recovery, append endu79:26055 as
follows:ALT_APPLICATION_SERVER=endu79:26055.
Restoring or recovering MongoDB data using NetBackup 63
Recovering a MongoDB database using the command line
Use these steps from the command line interface to recover a MongoDB database:
1. Create or modify the rename file if you want to recover the MongoDB database
to an alternate location
BIGDATA_MONGODB RestoreOnly
BIGDATA_MONGODB RecoverOnly
BIGDATA_MONGODB PointInTime
change /MongoDBnode_hostname1:port1/db1 to /MongoDBnode_hostname2:port2/db2
BIGDATA_MONGODB RestoreOnly NO
BIGDATA_MONGODB RecoverOnly NO
BIGDATA_MONGODB RecoverPointInTime 1290571200
For recovery and changing MongoDB node hostname, port, or database path:
BIGDATA_MONGODB RestoreOnly NO
BIGDATA_MONGODB RecoverOnly NO
BIGDATA_MONGODB RecoverPointInTime 0
change /MongoDBnode_hostname1:port1/db1 to /MongoDBnode_hostname2:port2/db2
Restoring or recovering MongoDB data using NetBackup 65
Recovering a MongoDB database using the command line
After making the required changes in the rename file, you can run the bprestore
command. For more information, See “Using the command line to recover a
MongoDB database” on page 65.
Where,
-C
Specifies the MongoDB cluster node and port number that you have backed
up.
-D
Specifies a file (listfile) that contains a list of files to be restored and can
be used instead of the file names option (filenames). In listfile, list each
file path must be on a separate line.
For MongoDB, the file list must contain <MongoDBnode_hostname>:<port> of
all the MongoDB nodes.
-p
Specifies the name of allowed list file path in which to write progress information.
Restoring or recovering MongoDB data using NetBackup 68
Manual steps after the recovery process
■ After the recovery process is complete, manually add the secondary nodes to
the cluster.
For more information, refer to the following article:
add-members-to-the-replica-set
■ After the recovery operation, the mongod or mongos process is started using the
configuration files from the /tmp location. Ensure that you move the configuration
files to a selected location and restart the services from that location.
Remove the configuration files from the /tmp location so that the restore or
recovery operations can restore files at the /tmp location with the same name
for different users. If you do not remove the files, the subsequent recovery
operations using a different user fails with error 2850 because the configuration
files cannot be restored at the /tmp location.
You can add more MongoDB configuration parameters if there are any changes
from the backup data that is restored.
Chapter 6
Troubleshooting
This chapter includes the following topics:
Limitation Workaround
In a sharded MongoDB cluster with high availability that In case the mongos processes are not shutdown before
contains multiple mongos processes, before starting a starting the restore and recovery, then after recovery you
restore and recover operation, only the mongos process must manually shutdown the stale mongos processes and
on the restore destination for the Config Server Replica then restart all the recovered mongod and mongos
Set (CSRS) image should be running. processes under cluster.
Manually stop any other mongos processes in the cluster
before starting a restore and recover operation.
Limitation Workaround
If the authentication type that was present during backup Ensure that the authentication type during recovery
changes and you run a recovery job that requires a remains the same as the type used during the backup.
different authentication, the recovery process might fail.
During recovery, ensure that you select only one full N/A
backup image and its relevant subsequent incremental
images. If you select more than one image, the recovery
may fail as the restored data could be corrupted.
After your recover the MongoDB cluster, the cluster After the recovery process is complete, manually add the
information for only the restored node is available. secondary nodes to the cluster.
During the restore process, “The restore was successfully Ensure that Source Client and Destination Client are
initiated” popup is displayed, but the restore job does not entered correctly. The Source Client must be the
start. Application Server and the Destination Client must be the
backup host.
This issue occurs when you enter the Application Server
in both the Source Client and Destination Client in the BAR
UI.
The NetBackup for MongoDB plug-in does not support the N/A
command line bprestore options -w and
-print_jobid.
Troubleshooting 72
Known limitations for MongoDB protection using NetBackup
Limitation Workaround
If you restore the MongoDB database to a non-LVM Restore the data to an LVM location and then try to take
location and then try to take a backup from this non-LVM a backup of the restored data.
location, the backup fails.
When you cancel a child restore job during the MongoDB N/A
restore and recovery process, the thin client (mdbserver)
is not removed immediately. The thin client is removed
after the next restore operation.
MongoDB restore fails and displays error 2850. Ensure that the destination host and port is valid and has
the credentials configured using the tpconfig command
and the credentials file. For more information, refer to the
tar logs.
After recovery, the MongoDB shard node fails to restart On the MongoDB shard where the problem occurs, start
manually and the following error is seen in the MongoDB MongoDB in the maintenance mode and run the following
logs: method on the system.version collection in the admin
database:
NoSuchKey: Missing expected field
"configsvrConnectionString" use admin
db.system.version.deleteOne
( { _id: "minOpTimeRecovery" } )
Troubleshooting 73
Known limitations for MongoDB protection using NetBackup
Limitation Workaround
rs.conf()
5 Repeat the steps for the other replica sets and the
members, or just the replica set members.
Backup jobs fail and the following error codes are Ensure that the backup windows for incremental backups
displayed: are different for the same MongoDB cluster. The backup
windows must not overlap each other for incremental
■ (50) client process aborted
backups for the same MongoDB cluster.
■ (1) The requested operation was partially successful
■ (112) no files specified in the file list Ensure that permissions are in place for the mdbserver
location, oplog location, and snapshot mount location.
For more information, See “Using a non-root user as a
host user” on page 38.
An error 112 can also indicate that same hosts names for
multiple backup hosts are added to the BigData policy.
Use unique host names for multiple backup hosts that are
running the backup operations.
Troubleshooting 74
Known limitations for MongoDB protection using NetBackup
Limitation Workaround
Backup operation fails if a command that generates output Ensure that no output is generated by .bashrc (echo or
in .bashrc is added. any other output generating command). The output should
not return STDERR or STDOUT when the shell is
Backup fails with error 6646 and displays the following
non-interactive.
error:
When you select two full backup images and try to restore Workaround:
to a point-in-time image that is between the two full backup
During the restore and recovery operation, do not select
images, the latest full backup image is restored.
more than one full backup image.
(6625) The backup host is either unauthorized to complete On the server where MongoDB is intalled, ensure that
the operation or it is unable to establish a connection with PasswordAuthentication is not disabled in
the application server. /etc/ssh/sshd_config file.
Limitation Workaround
(6646) Unable to communicate with the server. Ensure that the backup host can access the defined port
in mongodb.conf file or the default mdbserver_port
(11000).
There could be an error while copying the thin client files
on the MongoDB server because of the following:
error-sudo: sorry, you must have a tty to ■ To disable the requiretty option globally, in the
run sudo sudoers file, replace Defaults requiretty with
Defaults !requiretty. This action changes the
global sudo configuration.
■ You can change the sudo configuration for the user,
group, or command. On the server where MongoDB
is installed, add the host user, or group, or command
in the sudoers file.
Add Defaults /path/to/my/bin !requiretty
Add Default <host_user> !requiretty
MongoDB Restore fails with the error 2850 The target database path does not exist and there are
insufficient permissions for the non-root user.
Workaround:
Ensure that the target database path exists and there are
sufficient permissions for the non-root user.
Troubleshooting 76
Known limitations for MongoDB protection using NetBackup
Limitation Workaround
(13) file read failed for Media ■ NetBackup version on the master server is the latest.
■ NetBackup version on the media server is the same
as the master server but newer than the NetBackup
client version on the backup host.
■ NetBackup client version on the backup host is the
same as or older than the media server.
Snapshots are not deleted and stale mdbserver instances Change the configuration settings for the following
are seen. This scenario might cause Cannot lstat parameters in the mongodb.conf file:
errors during backup and partially successful backups.
■ cleanup_time_in_min
■ mdbserver_timeout_min
Set the values such that the stale snapshots and stale
instances of mdbserver are cleared before the next full
or incremental backup schedule.
Troubleshooting 77
Known limitations for MongoDB protection using NetBackup
Limitation Workaround
Limitation Workaround
Workaround:
Limitation Workaround
Limitation Workaround
Limitation Workaround
Workaround:
For example:
"application_servers":
{
"original.mongodb.cluster.com:26050":
{
"alternate_config_server":
[
{
"hostname:port":
"alt.mongodb.cluster.com:26000",
"mongos_port": "26001"
}
],
"mongos_port": "26051"
}
}
"application_servers":
{
"original.mongodb.cluster.com:26050":
{
"mongos_port": "26051"
},
"alt.mongodb.cluster.com:26000":
{
"mongos_port": "26001"
Troubleshooting 82
Known limitations for MongoDB protection using NetBackup
Limitation Workaround
}
}
Work Around:
Enter option :4
Enter option :1
2) UPDATE Credentials
3) DELETE Credentials
4) Return to previous menu
Enter the RSA key of the MongoDB host [On the MongoDB host, run the
command "cat /etc/ssh/ssh_host_rsa_key.pub | awk '{print $2}' | base64
-d| openssl dgst -sha256 | awk '{print $2}'"] : RSA-KEY-OF-THE-HOST
Enter MongoDB database user : mongodb-shell-login-user
Enter MongoDB database user password :
Do you have more secondary servers for this primary server? (y/n) :n
------------------------------------------------------------------------------------------
Primary Server :
Server Hostname : host1.fqdn.com
Server Mongod Port : 28000
No of Secondary Servers : 1
HostUser: root
HostPassword: ******
AppUserId: mongodb-shell-login-user
AppUserPassword: ******
HostRsaKey: RSA-KEY-OF-THE-HOST
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
******Please make sure to save this entered config and credentials. If you
don't save it now, you will have to enter it again.******
Enter option :4
Enter option :1
--
Update host1.fqdn.com:28000 replica set MongoDB cluster configuration
A P
Adding parallel streaming framework 12
backup host 39 policies
allowed list configuring 46
backuphost 40
R
B Removing
Backup 44 backup host 39
backup 42 restore 51
BigData policy
Command Line Interface 48 T
NetBackup Administration Console 46
terms 14
Policies utility 47
Policy Configuration Wizard 47
C
compatibility
supported operating system 20
Creating
BigData backup policy 46
L
Limitations 15
M
MongoDB credentials
adding 34
N
NetBackup
debug logging 69
O
overview
backup 12
configuration 12
deployment 12
installation 12
restore 12