Database Sharding is considered to be the horizontal partitioning of a database or the search engine where each partition is called as a Shard. This is a process of compressing the data collections by splitting the database instances across multiple databases. This in turn fastens the speed of MongoDB CRUD operations. MongoDB creates Shard keys which distribute the data across multiple shards.

Purpose of database sharding

Due to following reasons database sharding holds an important place in MongoDB –

  • Scaling out to multiple nodes
  • Easy to add new machines
  • Automatic balance of load
  • Zero downtime
  • Automatic failure recovery

Process of creating database shard

Follow the given steps to create a database shard-

  1. Create a batch file with the name bat at the root of MongoDB's bin folder.
  2. Write following lines on the batch file:

mkdir"data/localhost10000"

mongod –rest –shardsvr –port 10000 –dbpath data/localhost10000 –logpath data/localhost10000/log.txt
PAUSE

  1. Create another batch file with the name bat at the root of MongoDB's bin folder.
  2. Write following lines on the batch file:

mkdir "data/localhost10001"
mongod –rest –shardsvr –port 10001 –dbpath data/localhost10001 –logpath data/localhost10001/log.txt
PAUSE

  1. Run RunServer10000.bat
  2. Run RunServer10001.bat

Mongo DB Sharding的更多相关文章

  1. mongo DB for C#

    (1)Download the MongoDB C#驱动. http://www.nuget.org/packages/mongocsharpdriver/. (2) Add Reference to ...

  2. Mongo DB 2.6 需要知道的一些自身限定

    在现实的世界中,任何事情都有两面性,在程序的世界中,亦然! 我们不论是在使用一门新的语言,还是一门新的技术,在了解它有多么的让人兴奋,让人轻松,多么的优秀之余,还是很有必要了解一些他的局限性,方便你在 ...

  3. Mongo DB Study: first face with mongo DB

    Mongo DB Study: first face with mongo DB 1.  study methods: 1.  Translate: I am the mongo DB organiz ...

  4. mongo db 分享 ppt

    在公司内部的mongo db的ppt.初步进阶 http://files.cnblogs.com/files/yuhan-TB/mongoDB.pptx

  5. Mongo DB 安装-及分布式集群部署(初稿)

    一.安装步骤, 1, 下载最新的Mongo DB数据库:http://www.mongodb.org/downloads?_ga=1.44426535.2020731121.1421844747\ 下 ...

  6. mongo db 使用方法

    1 下载 mogodb http://www.mongodb.org/display/DOCS/Downloads 2 打开服务 我安装在e盘下了 可以指定数据文件位置 到 E:\mongoDB\mo ...

  7. mysql 和 mongo db 语法对比

    本文描述了MySQL中的常用SQL语句在MongoDB中的写法,如果你长期使用MySQL而对MongoDB跃跃欲试,这篇简单的文章可以帮助你更快的进入角色.查询:MySQL:SELECT * FROM ...

  8. Mongo DB命令简介

    引言   最近在学习MongoDB 总结了一些命令及常用的东西做整理   常用目录文件介绍 mongod 数据库部署命令 mongo 连接mongodb数据库而使用的命令 mongoimport 导入 ...

  9. Java从入门到精通——数据库篇Mongo DB GridFS文件系统

    一.概述    GridFS是MongoDB的一种存储机制,用来存储大型二进制文件. 优点: 1.使用GridFS能够简化你的栈.如果已经在使用MongoDB,那么可以使用GridFS来代替独立的文件 ...

随机推荐

  1. Who is YaoGe.(搞笑篇)

      耀哥是google的大牛.主持google各种牛逼分布式系统的设计,比方Mapreduce之类的,关于大神的传说,如同春哥一样多,当然,有些传说仅仅有程序猿能明确! 耀哥当初面试Google时.被 ...

  2. Dapper-translation 分布式监控系统

    http://bigbully.github.io/Dapper-translation/ https://github.com/bigbully/Dapper-translation

  3. win开启远程链接(可以被连接)

    电脑-属性,这样打开了控制面板,坐车选择远程设置,选择允许任何人链接,然后关闭防火墙即可.

  4. swift笔记(二) —— 运算符

    基本运算符 Swift支持大部分的标准C语言的操作符,而且做了一些改进,以帮助开发人员少犯低级错误,比方: 本该使用==的时候,少写了个=, if x == y {-} 写成了 if x = y {- ...

  5. C#中一种替换switch语句更优雅的写法

    今天在项目中遇到了使用switch语句判断条件,但问题是条件比较多,大概有几十个条件,满屏幕的case判断,是否有更优雅的写法替代switch语句呢? 假设有这样的一个场景:商场经常会根据情况采取不同 ...

  6. Python index()方法

    Python index()方法  Python 字符串 描述 Python index() 方法检测字符串中是否包含子字符串 str ,如果指定 beg(开始) 和 end(结束) 范围,则检查是否 ...

  7. Javascript 身份证号获得出生日期、获得性别、检查身份证号码

    //---------------------------------------------------------- // 功能:根据身份证号获得出生日期 // 参数:身份证号 psidno // ...

  8. EntityFramework:状态变化与方法的关系(朋友的学习笔记)

    一.约定OnModelCreating 有一些限制需要注意,例如: 1.表名不支持使用标签进行标注 2.最小长度在 OnModelCreating 中不支持 3.正则表达式在 OnModelCreat ...

  9. python测试开发django-20.添加创建时间DateTimeField

    前言 我们在admin后台发布一篇文章的时候,一般会有创建时间和最后更新时间这2个字段,创建时间就是第一次编辑文章的时候自动添加的,最后更新时间就是每次修改文章的内容后自动更新 在models.py建 ...

  10. skb的两个函数pskb_copy和skb_copy

    转自:http://blog.csdn.net/farmwang/article/details/54235252 skb的两个函数pskb_copy和skb_copy 前者仅仅是将sk_buff的结 ...