Reference Guide

Figure 57. Enabling security
4. Create mongod.key.txt file and copy on all the three servers.
NOTE: Ensure that the mongod.key.txt file content or key is the same in all the three servers.
Figure 58. Copy the mongod key file
5. After you copy the file, stop the mongod service by running the following command:
net stop mongodb
6. Start the mongod service by running the following command:
net start mongodb
7. Repeat the steps from 1 to 6 in all the three nodes of MongoDB servers.
8. Initiate replication on the primary node of the MongoDB cluster logging in using DBadmin user and then run the following
command:
rs.initiate();
C:\Mongo\bin>mongo.exe -u root -p x` admin
MongoDB shell version v4.2.1
connecting to: mongodb://127.0.0.1:27017/admin?
compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("952f322c-1eb4-46c4-9b5e-bd536e2c1e7e") }
MongoDB server version: 4.2.1
MongoDB Enterprise > use admin
switched to db admin
MongoDB Enterprise >
MongoDB Enterprise >
MongoDB Enterprise > rs.initiate();
{
"info2" : "no configuration specified. Using a default configuration for the set",
"me" : "10.150.132.37:27017",
Achieve high availability on MongoDB
63