8-day learning MongoDB (actual operation version)-building a learning deployment environment on the ninth day

Source: Internet
Author: User

Based on previous studies, we have learned several major server roles in MongoDB:

    1. Mongos, the entry server of the MongoDB cluster, mainly undertakes data routing tasks. It distributes data to its own MongoDB Cluster Based on the configured "partition key;
    2. Configserver: the server role is responsible for managing mongos data shards, the relationship between data and shards, and the corresponding configuration information (note that the number of configservers must be 1 or 3)
    3. Shardserver, an independent shard D server, is integrated into mongos for unified management and storage of sharded data;
    4. Shardserver (repset) is the shard server in the replica set. Each replica set requires at least two shardservers;
    5. Arbiterserver: The arbitration server in the replica set. Each replica set requires at least one arbiterserver;

For details, we need to deploy two mongos portals, three configservers, one independent shardserver and one repset (including two shardservers and one arbiterserver). A total of nine mongod instances are required.

I decided to deploy these eight instances on three computers respectively (one physical host and two virtual machines)

Physical server (192.168.111.11)

    • Configserver-I (disk D)
      Mongod -- configsvr -- dbpath = D: \ MongoDB \ dB -- port 2000
    • Shardserver (disk C)
      Mongod-dbpath = c: \ MongoDB \ DB-port 4000
    • Arbiterserver (Elastic Block Storage)
      Mongod -- dbpath = E: \ MongoDB \ DB-port 4004-replset superlab/192.168.111.111: 4000

Virtual Server-I (192.168.111.111)

    • Configserver-II (disk D)
      Mongod -- configsvr -- dbpath = D: \ MongoDB \ dB -- port 2000
    • Mongos (disk C)
      Mongos -- Port 8848 -- configdb = 192.168.111.111: 2000,192.168 .111.222: 2000,192.168 .111.11: 2000 (disk C)
    • Shardserver (repset) (Elastic Block Storage (edisk) must be larger than 2 GB)
      Mongod -- dbpath = E: \ MongoDB \ dB -- port 4000 -- replset Halab/192.168.111.222: 4000

Virtual Server-II (192.168.111.222)

    • Configserver-III (disk D)
      Mongod -- configsvr -- dbpath = D: \ MongoDB \ dB -- port 2000
    • Mongos (disk C)
      Mongos -- Port 8848 -- configdb = 192.168.111.111: 2000,192.168 .111.222: 2000,192.168 .111.11: 2000 (disk C)
    • Shardserver (repset) (Elastic Block Storage (edisk) must be larger than 2 GB)
      Mongod -- dbpath = E: \ MongoDB \ dB -- port 4000 -- replset Halab/192.168.111.111: 4000
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.