Mongodb Classroom image

Anil  Bist / Professional / DataBase
 
To post your Question Join Classroom
 
Lesson Topics's No:-  ||
Lessons:-Sharding Environment Setup

Mongo as Shards

Sharding Environment Setup

Sharding Group Members :

For sharding there are three players.
1. Config Server
2. Replica Sets
3. Mongos

            For a mongo shard we need to setup the above three servers.

Config Server Setup : add the following to mongod conf file

run :  mongod --config

we can choose config server as replica set or may be a standalone server. Based on our requirement we can choose the best. If config need to run in replica set we need to follow the replica set setup

Replica Setup : Create replica set // Please refer the replica setup
MongoS Setup : Mongos is main setup in shard. Its is query router to access all replica sets

     Add the following in mongos conf file

 

Configure Shared :

Connect the mongos via shell (mongo --host --port )

1. sh.addShard( "/s1-mongo1.example.net:27017")
2. sh.enableSharding("")
3. sh.shardCollection("< database >.< collection >", { < key > : < direction > } )
4. sh.status() // To ensure the sharding

 
 
 
image
Anil  Bist

Skills    Mongodb

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail" this is my first web development framework and we worked in this framework and develop four to five project after some time , I moved to JEE/Sturst frame work,

After some time i decided that now times come and I have to go on in my own way and I started a company name is "Soarlogic&q
Explore

 

  Students (0)