MongoDB's distributed cluster (4, shard and replica set combination)

Source: Internet
Author: User

Overview

The first 3 blogs about MongoDB's distributed and clustered, where the primary master-slave replication We almost do not have any meaning, the remaining two, regardless of which we use each, will have a corresponding problem, a better solution is that the collection of shards and replica sets to use, so it is more perfect.


deployment Diagram

Here, we need to note that we MONGOs server configured as a cluster, so we need to add the corresponding address on the client, this and in the copy set of the same blog in the content, the Java client program in the specific core code, in that blog also gave you, If this is unclear, you can look at that blog post. configuration of a shard cluster
Shard cluster configuration    //start each config    mongod--dbpath/data/mongodbtest/config/data--port 27017     //start each MONGOs    MONGOs --configdb 192.168.24.201:27017,192.168.24.202:27017,192.168.24.203:27017           --port 27017    //log in each MONGOs add shards ( Omit configuration Replica Set procedure) Use    admin    db.runcommand ({addshard:                      "shard1/192.168.24.1:27017,                             192.168.24.2:27017,                             192.168.24.3:27017 "});    Db.runcommand ({addshard:                      "shard2/192.168.24.11:27017,                             192.168.24.12:27017,                             192.168.24.13:27017" });
The above configuration is the core of the configuration, which involves the replica set and other aspects of the specific configuration, you can refer to the previous articles, here will not repeat

SummaryMongoDB learning process, my most difficult stage is not in the learning of distributed cluster this piece of content, but in the simplest environment configuration, that process, I need to download the corresponding server from the official website, download the corresponding client driver, and then do a simple instance, the process is the most difficult, Once through that process, the rest is not a thing.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

MongoDB's distributed cluster (4, shard and replica set combination)

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.