MONGODB Cluster Replication Deployment

Source: Internet
Author: User

Introduction:

This article summarizes the cluster replication set deployment steps for the MongoDB 3.2 release.

Requirements:• The cluster contains 2 shards (shard)• Each shard is a 1 replica set• Partitioned replica sets, configuration servers need to take into account the case of a single machine failure to ensure availability• Set the MongoDB service oplogsize for each shard below 100 in order to reduce the disk space of the experimental data and speed up the experiment• Before deployment, prepare for deployment and document the deployment architecturePre-Deployment preparation:According to the requirements, draw out the cluster deployment architecture diagram as shown in:two Linux servers with a server version of CentOS-6.6, two replica sets for highly available configurations, three slices per replica set, and three configuration servers to ensure high availability. the ports that are open are as follows: To start the configuration work:First step: Create a DirectoryStep Two: Configure three configuration servers on the 1.mongodb.com
20000 --logpath/var/lib/mongo/data/configa/configa.log--logappend--dbpath/var/lib/mongo/data/configa--  20001 --logpath/var/lib/mongo/data/configb/configb.log--logappend--dbpath/var/lib/mongo/data/ CONFIGB--20002 --logpath/var/lib/mongo/data/configc/configc.log--logappend--dbpath/var/lib/ MONGO/DATA/CONFIGC--fork

Step Three: Configure the secondary 3 instances on 1.mongodb.com and 2.mongodb.com

To configure replica instances on 1.mongodb.com

27017  -   27018 27019

To configure replica instances on 2.mongodb.com
27017  -   27018 27019

Fourth Step: Configure route, mongos instance in 1.mongodb.com
1. mongodb.com:20000,1. mongodb.com:20001,1. mongodb.com:20002 --fork--logappend--logpath/var/lib/mongo/data/--1. mongodb.com:20000, 1. mongodb.com:20001,1. mongodb.com:2000230000

Check all of the above configurationsFifth Step: Configure the replica set
27017 Use adminrs.conf ()

config={_id: "a", Members : [{_id:0, Host: '1. mongodb.com:27017', priority:10},{_id:1, Host: '1. mongodb.com:27018', priority:1},{_id:2, Host: '1. mongodb.com:27019', priority:1},]}config={_id: "b", Members : [{_id:0, Host: '2. mongodb.com:27017', priority:10},{_id:1, Host: '2. mongodb.com:27018', priority:1},{_id:2, Host: '2. mongodb.com:27019', priority:1},    ] }

Sixth step: Shard Configuration
Sh.addshard ("A/1. mongodb.com:27017") Sh.addshard ("B/1. mongodb.com:27017 ")

MONGODB Cluster Replication Deployment

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.