Saturday, April 11, 2015

M102: MongoDB for DBAs : Homework 4.1

Step 1:
Download Handout

Step 2:
Unpack replication.js from the Download Handout zip file.

Step 3:
You need to create 3 different directory for 3 replica set

on windows:
you can create diretory as 1 , 2 and 3 in c drive

you can start mongod instance using
mongod --dbpath 1 --port 27001 --smallfiles --oplogSize 50


Step 4:
you can import replication.js using

mongo --port 27001 --shell replication.js


Step 5:
Once the shell is up
you can write
homework.init();

then homework.a();


Above query will give your answer as
5001


No comments:

Post a Comment