The following is a list of considerations for restoring an entire MongoDB cluster to its cluster location (in place).
-
If mongod options (such as security/authentication and net/TLS) are enabled on a MongoDB server, post restore these options are retained. That means, the source mongod config file (at the time of backup) is restored to the original location and the server is started with the same configuration.
Note
The MongoDB user that is specified in the instance properties must have a root role. If you cannot assign the root role to the user, set the bMongoDbDisableAuthOnRestoredServer additional setting to start the server without authentication.
-
Start mongod as a service or a process:
-
If the mongod server is managed by systemctl, start the mongod as a service . To specify a different name for the mongod service, set the sMongoDbServiceName additional setting.
-
If the mongod server is a process, start mongod as a process.
Note
Before starting the restore operation, verify that the
systemctl status mongod
command returns exit code 4. The service unit files for default mongod installation should be renamed or deleted. This helps the restore operation to identify that the mongod server is configured to run as a process.Example:
[root@amongoclient ~]# find / -name mongod.service /etc/systemd/system/multi-user.target.wants/mongod.service /usr/lib/systemd/system/mongod.service [root@amongoclient ~]# mv /etc/systemd/system/multi-user.target.wants/mongod.service /etc/systemd/system/multi-user.target.wants/mongod.service.tmp [root@amongoclient ~]# mv /usr/lib/systemd/system/mongod.service /usr/lib/systemd/system/mongod.service.tmp [root@amongoclient ~]# systemctl daemon-reload [root@amongoclient ~]# systemctl reset-failed [root@amongoclient ~]# systemctl status mongod service [root@amongoclient ~]# echo $? #4
-
-
To always start te mongod server as a process, set the bMongoDbStartAsProcess additional setting.
-
The replica set is initiated with the same configuration parameters (such as votes, priority, and role) that are captured during backup.
-
The MongoDB configuration file is restored to the original location after restore.