MongoDB集群部署(基于docker)_badvalue: security.keyfile is required when author-CSDN博客
Docker 快速搭建 MongoDB 4.x 集群(一主一从)_docker mongo-CSDN博客
docker run -dit --name mongo -p 27017:27017 -v /mydata/mongo/mongo-keyfile:/data/configdb/mongoKeyfile.key -v /mydata/mongo/config/mongod.conf:/etc/mongod.conf -v /mydata/mongo/data:/data/db -v /mydata/mongo/logs:/var/log/mongodb -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=123456 --restart=always mongo --replSet rs0 --keyFile /data/configdb/mongoKeyfile.key
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "192.168.187.128:27017", priority: 3 },
{ _id: 1, host: "192.168.187.129:27017", priority: 2 },
{ _id: 2, host: "192.168.187.130:27017", priority: 1 }
]
});
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » docker 安装mongo 集群
发表评论 取消回复