MongoDB replica set configuration with user authentication

Source: Internet
Author: User
Tags base64 openssl download

After the Replica set is configured, you will not be able to sync after you have enabled the AUTH option, which steps should be missing from the authentication section.

Later found that the configuration is less keyfile, so it generates a.

KeyFile In fact there is nothing mysterious, as long as

    1. is a character in the Base64 character set,
    2. The length is between 6~1024,
    3. The whitespace characters are deleted by MongoDB,
    4. Each node is to use the same keyfile file ,
    5. The Linux environment needs to modify KeyFile permissions (chmod- mongodb-keyfile).

Since the example of the official MongoDB document is generated using OpenSSL, the Base64 encoded string can be misleading, keyfile must be generated using OpenSSL, be sure to use BASE64 encoding, which is actually not the case,

Can not be generated without OpenSSL, do not need Base64 encoding, as long as the length between 6~1024, Base64 character set character is OK, with your most convenient tool to complete one or casually enter some characters can be.

It's easy to see the official text (attached).

The Base64 character set is as follows:

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/

The modified configuration information is as follows:

1 replset = rs012true3270174 bind_ip = localhost  5true6 dbpath = e:\data\db7 logpath = e:\data\log\ Mongo.log8 keyfile = D:\mongodb\key

Reference:

1. Generate a Key file:http://docs.mongodb.org/manual/tutorial/generate-key-file/

2. OpenSSL download (Windows): http://www.openssl.org/related/binaries.html

MongoDB replica set configuration with user authentication

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.