MongoDB Master-Slave configuration

Source: Internet
Author: User
Tags auth

Configuration of Master# cat Mongod.confdbpath =/app/sinova/mongodata/db #指定数据库目录logpath =/app/sinova/mongodata/log/mongod.log #指定mongodb日志port = 50000 #指定端口fork = True #放在后台运行rest = True #开启web界面oplogSize =2048 #同步日 Log size Master = True #设置mongodb为master #auth = True configuration of the slave# cat Mongod.confdbpath =/app/sinova/mongodata/dblogpath =/app/sinova/mongodata/log/mongod.logport = 50000fork =                       Truerest = Trueslave = True #设置mongodb为slavesource = 10.20.45.11:50000 #指定master服务器slavedelay = 10 #同步延迟10秒autoresync = True #如果发现主从数据不一致, start synchronizing immediately #auth = True startup script: $ cat start_mongodb.sh
#!/bin/bash
/app/sinova/mongodb/bin/mongod--config/app/sinova/mongodb/conf/mongod.conf

MongoDB Master-Slave configuration

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.