map reduce on mongo db with sharding

7
MongoDB CRUD Operations : - Starting mongodb using mongod command by specifying the data directory using mongodb.conf file. Contents of conf file are below :- Connecting to mongo db using mongo command and inserting a sample record:

Upload: bharat-khanna

Post on 15-Apr-2017

81 views

Category:

Sports


2 download

TRANSCRIPT

Page 1: Map reduce on mongo db with sharding

MongoDB CRUD Operations : -

Starting mongodb using mongod command by specifying the data directory using mongodb.conf file.

Contents of conf file are below :-

Connecting to mongo db using mongo command and inserting a sample record:

Sharding in MongoDB :-

Page 2: Map reduce on mongo db with sharding

Configuring the mongodb's config server : -

Starting Shard controller :-

mongos --configdb bharat-Lenovo-G580:27018 --port 27019

Page 3: Map reduce on mongo db with sharding

Creating two shard directories, starting mongo on them and add those shard directories to shard file

Page 4: Map reduce on mongo db with sharding

Total daemons running now :-

Running MapReduce on downloaded article in MongoDB

Step 1 : Downloading the data in form of text file from chronicle website.Step 2 : Inserting the text file data to MongoDB using PyMongo script shown below.

Page 5: Map reduce on mongo db with sharding

Step 3 : Inserted data in pages collection in articles db is shown below :

MapReduce program on calculating wordcount for each article :

Page 6: Map reduce on mongo db with sharding

Output of word count :-

Dropbox Link for code :- https://www.dropbox.com/sh/ckxuf52hq1xsiyc/AAD-8KZqu6JtXi5bOM9-NdQ0a?dl=0

Thanks Bharat Khanna