See what you could do, I did the same on a separate PC
1.create 3 directory, in which data will be stored for example - c: / data / rep1, c: / data / rep2, c: / data / rep3
2. Close all previous mongodb instances
3. Through the command line, perform the following steps (if the ur path is set) else, go to the folder in which mongod exists
command line
/>mongod -port 27001 -dbpath -c:/data/rep1 -replSet replication
new command line
/>mongod -port 27002 -dbpath -c:/data/rep2 -replSet replication
new command line
/>mongod -port 27003 -dbpath -c:/data/rep3 -replSet replication
now connect to any of mongod via another command line
/>mongo -port 27001
then we need to write a replica set configuration
cfg={_id:"replication",members:[{_id:1,host:"localhost:27001"}, {_id:2,host:"localhost:27002"},{_id:3,host:"localhost:27003"}] } rs.initiate(cfg)
replication starts
rs.status()
source share