Map reduce on mongo db with sharding

  • View
    76

  • Download
    2

  • Category

    Sports

Preview:

Citation preview

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 :-

Configuring the mongodb's config server : -

Starting Shard controller :-

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

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

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.

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

MapReduce program on calculating wordcount for each article :

Output of word count :-

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

Thanks Bharat Khanna