Cluster authentication
Introduction: We introduced the single strength of the certification method, just I am engaged in Lepus monitoring, replica collection requires user authentication
A verification method:
1 Auth mode start = "Single point"
2 keyfile Mode start = "Cluster"
Please note that account opening keyfile default account auth
Two Create keyfile files
1 Creating requirements
1. Content base64 encoding set [A-Z-a-+/]
2. Length 1000bytes
3. Permission at least chmod keyfile
2 How to create
OpenSSL rand-base64 102 >. KeyFile
chmod 600. KeyFile (must be 600 permissions, please note)
Three Create Super Admin users
Db.createuser ({
User: "Root",
PWD: "123456",
Roles: [{role: ' Root ', db: ' admin '}]
});
Purpose: In order to create a user
Four modifications
1 shut down from mongo-> and then close the main MONGO
2 Add keyfile=/data/mongo/shard2/in the configuration startup item. KeyFile (Modify all nodes)
3 copy keyfile to all nodes
4 Start the main mongo-> boot from MONGO
Five verification
mongo-uroot-p123456 Admin--port=27015,
Login successful, Representative complete
This is my understanding of MONGO cluster user authentication
MongoDB Second article ~ about cluster authentication that's something