MongoDB master-Slave and auth master-slave configuration detailed

Source: Internet
Author: User

1. Primary server Configuration #auth = True DBPath =/data/mongodb/db LogPath =/data/mongodb/log/mongodb.log Port = 27017 Fork = True #以 Daemon is enabled, that is, running in the background Nohttpinterface = True Logappend=true master=true 2, configuration from server #auth = True DBPath =/data/mongodb/ DB LogPath =/data/mongodb/log/mongodb.log Port = 27017 Fork = True #以守护程序的方式启用, which is run in the background Nohttpinterface = True Logappe Nd=true slave=true source=101.101.101.190 3, start 4. Master-slave Safety  This master-slave security in the MongoDB official website said very clearly. cannot be verified with normal Mongod permissions.   In addition to the need to join-auth also need to add-keyfile validation.   First, we generate our keyfile, according to the official website to provide the instructions, this keyfile can be arbitrary content, as long as all the machines in the cluster have the same files. In the Linux environment, we generated our keyfile through the command of OpenSSL rand-base64 741 >/opt/mongodb/bin/mongo-keyfile.   After the build, you can specify it when you start Mongod. In the master-slave configuration file, add the following configuration 1, open auth 2, add keyfile keyfile =/opt/mongodb/bin/mongo-keyfile 5, Problems encountered permissions on/opt/mongodb/bin/m Ongo-keyfile is too open modify chmod 400/opt/mongodb/bin/mongo-keyfile

MongoDB master-Slave and auth master-slave configuration detailed

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.