博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mongo DB Sharding
阅读量:6827 次
发布时间:2019-06-26

本文共 1321 字,大约阅读时间需要 4 分钟。

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

转载于:https://www.cnblogs.com/time-is-life/p/8335339.html

你可能感兴趣的文章
程序源代码行数分析统计器
查看>>
DNGuard Enterprise v2.80 released
查看>>
[超强]废旧硬盘改造成扬声器!!
查看>>
WPP
查看>>
C# GetSchema Get List of Table 获取数据库中所有的表名以及表中的纪录条数的方法
查看>>
PySide教程:“.NET研究”第一个PySide应用
查看>>
winrar自解压释放路径详解
查看>>
图像开运算+闭运算+腐蚀+膨胀
查看>>
poj-1324 Holedox Moving **** [转]
查看>>
深入foreach工作方式
查看>>
Linux curl使用简单介绍(转)
查看>>
UIView 进行各种动画展示及其用法解释
查看>>
公布2012年5月赛CSDN算法达人赛试题及参考答案
查看>>
Mysql ON子句和USING子句
查看>>
linux杂谈
查看>>
类型、值和变量
查看>>
UIImage+Scale
查看>>
Linux sed 替换第一次出现的字符串
查看>>
windows 下VLC播放器应用之二------LIBVLC API解析
查看>>
用户权限管理,LINQ去除它的重复菜单项
查看>>