嘉兴网站建设多少钱广州装修公司口碑最好的是哪家
前言
MongoDB 使用 keyFile 进行 节点间身份验证,我们需要先创建一个 keyFile 并确保所有副本集的节点使用相同的 keyFile。
openssl rand -base64 756 > mongo-keyfile
chmod 400 mongo-keyfile
docker-compose部署分片集群
无密码方式
# docker-compose-mongodb.yml
services:# Config Server Replica Setconfigsvr1:image: mongo:latestrestart: alwaysentrypoint:["mongod","--port","27017","--configsvr","--replSet","cfgset","--dbpath","/data/configdb","--bind_ip_all"]volumes:- /data/mon