Reference Guide

2 Go to \data\bin\mongod.cfg directory, and open mongod.cfg le in a text editor.
3 Add the following three lines in the mongod.cfg le:
keyFile: c:\data\log\mongod.key.txt
replication:
replSetName: wms
Figure 57. Enabling security
4 Create mongod.key.txt le and copy on all the three servers.
NOTE
: Ensure that the mongod.key.txt le content or key is the same in all the three servers.
Figure 58. Copy the mongod key le
5 After you copy the le, 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 tree 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();
62
Achieve high availability on MongoDB