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
  • 相关阅读:
    VS2013中using System.Windows.Forms;引用不成功
    <C#任务导引教程>练习五
    <C#任务导引教程>练习四
    <C#任务导引教程>练习三
    <C#任务导引教程>练习二
    printf("%d ",printf("%d",printf("%d",i)));
    <C#任务导引教程>练习一
    C代码
    SQLServer创建约束
    SQL语句修改字段类型与第一次SQLServer试验解答
  • 原文地址:https://www.cnblogs.com/time-is-life/p/8335339.html
Copyright © 2011-2022 走看看