Mongodb Master-Slave synchronization

Source: Internet
Author: User

First step: We put MongoDB on multiple servers on 10.12.0.3 and 10.14.0.1.

Step two: Start MongoDB on 10.12.0.3, designate the database as the primary database

Start the master first:

25019 --fork--logpath/var/log/mongo/mongdb1.log--dbpath/data/db/  --master

Start again from:

10.12. 0.3:25019 --dbpath/opt/product/mongodb/data

The syncing from host:10.12.0.3:25019 instructions have been copied from the primary database.

FAQ Processing:

Issue one: Perform synchronization from the server, error: ErrMsg: "Not authorized the admin to execute command"

Cause: The master boot carries the--auth. MONGO is not authenticated by default. Remove the problem after solving.

Issue two: [Replslave]--source 192.168.1.32:25019! = 19.168.1.30:25019 from local.sources collection

Cause: At the very beginning, we have specified master's host and port for Slave, which is inserted into the Local.sources collection. So, change the master port to 10000.

Mongodb Master-Slave synchronization

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.