MongoDB Architecture Chapter

Source: Internet
Author: User

First, copy set

    1. Replica the schema of the set
    2. Deployment of Replica Set
    3. Master-Slave operation Log
      1. Inside the Local Database: Db.oplog.rs.find ()
      2. Basic information for the log: Db.printreplicationinfo ()
      3. View slave's presentation status: Db.printslavereplicationinfo ()
      4. Master/Slave configuration information: Db.system.replset.find ()
    4. Managing replica Set
      1. Master-Slave switching

1 Frozen instances do not participate in primary elections: Rs.freeze (30)

2 downgrade: Rs.stepdown (30)

    1. Read/write separation

1 Make slave readable: db.getMongo.setSlaveOk ()

    1. Failover: Kill Process
    2. Add or Subtract nodes

1 Add node: Rs.add ("localhost:27017")

2 Reduction node: Rs.remove ("localhost:27017")

Second, The Shard

    1. sharding Introduction
      1. Features of Sharding

1 extensibility

2 increasing the high availability of databases

3 Pressure separation

    1. Architecture of the Sharding

1 sharding Server: Each database server that stores shards.

2 Configuration Server: Node configuration information, chunk Shard key range, distribution, configuration information.

3 Routing Process: forwarding

    1. The construction of sharding cluster
    2. Maintenance of Sharding
      1. List all sharding Server:db.runCommand ({listshards:1})
      2. View Sharding's information: Printshardingstatus ()
      3. Determine if it is Sharding:db.runCommand ({isdbgrid:1})
      4. Sharding:db.runCommand the table ({shardcollection: "Ken.ken", Key:{_id:1}})
      5. New Sharding Server:db.runCommand ({addshard:locahost:27020})
      6. Remove Sharding Server:db.runCommand ({remove:localhost:27020})

Third, Replica sets+sharding architecture

    1. Combine replication sets and sharding machines

MongoDB Architecture Chapter

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.