zoukankan      html  css  js  c++  java
  • Mongo DB Sharding

    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
  • 相关阅读:
    Linux下用wget下载百度网盘资源
    android系统编译记录
    ubuntu 安装JDK & eclipse
    Linux安全攻略-僵尸进程
    smack user登陆
    smack 创建账户
    我的第一个开源App(彩票开奖查询)
    REST简介
    HTTP 状态码
    测试 ScribeFire Blog Editor
  • 原文地址:https://www.cnblogs.com/time-is-life/p/8335339.html
Copyright © 2011-2022 走看看