1: Replica Set configuration reference this blog:
Http://www.cnblogs.com/xiaoit/p/4478951.html
2: Authentication of replica set
Suppose there are two machines that have been configured with a replica set (the crime of replica set is generally at least 3 machines, here only for demonstration use)
192.168.91.132
192.168.91.133
The general idea of a replica set is the user name, password, and keyfile file, KeyFile requires that each replica set service be loaded at startup and if the same file is required, then the user name, password
The KeyFile file must meet the criteria:
(1) A minimum of 6 characters, less than 1024 bytes
(2) When the certificate does not consider the blank characters in the file
(3) The contents of the KeyFile file connected to the replica set and MONGOs must be the same
(4) must be Base64 encoded, but cannot have an equal sign
(5) file permissions must be x00, that is, you cannot assign any permissions to group members and other members
Performed on 132
[email protected] ~]# OpenSSL rand-base64 >/root/software/mongodb/keyfiletest
Then the file SCP to 133 above
SCP /root/software/mongodb/keyfile [email protected]:/root/software/mongodb/
Kill Mongod Process: Pkill-2 Mongod (can also db.shutdownserver (), but not pkill-9)
Restarting the Mongod process
./mongod--config/root/software/mongodb/mongo.conf--keyfile/root/software/mongodb/keyfile
Authentication OK. The user name password can then be created.
For details, please refer to here:
http://docs.mongodb.org/manual/reference/security/
MongoDB Replica Set Configuration Series III: Authentication method for Replica sets