mongodb - MongoDB集群-CSRS无法启动

标签 mongodb docker docker-compose devops

我正在尝试在this guide之后在本地环境中使用docker配置mongo sharded集群,并陷入第一步。问题是,配置服务器副本集无法正确启动。
enter image description here

我尝试了to disable enableMajorityReadConcern ,但未成功。看来配置服务器必须将此设置为true。
这些对我来说看起来很奇怪:

*2018-11-14T16:55:38.669+0000 I REPL     [initandlisten] Did not find local replica set configuration document at startup; NoMatchingDocument: Did not find replica set configuration document in local.system.replset* 

*2018-11-14T16:55:38.669+0000 I CONTROL 
[LogicalSessionCacheRefresh] Failed to create config.system.sessions:
Cannot create config.system.sessions until there are shards, will try
again at the next refresh interval* 

*2018-11-14T16:55:38.669+0000 I
CONTROL  [LogicalSessionCacheRefresh] Sessions collection is not set
up; waiting until next sessions refresh interval: Cannot create
config.system.sessions until there are shards*

我尝试了3个容器实例方案-所有3个容器实例显示的日志输出与单个容器方案相同。任何想法都欢迎!

最佳答案

解决了问题。当CSRS首次启动时-这是预期的行为。 rs.init()命令(部署指南中的第3步)必须通过mongo shell 执行,以使CSRS最终得到配置并启动。命令可以在CSRS的任何单个节点上执行。

关于mongodb - MongoDB集群-CSRS无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53305470/

相关文章:

docker - 将 ansible delegate_to 与 docker : permission denied 一起使用

linux - 部署Web UI时"The ClusterRoleBinding "kubernetes-dashboard "is invalid: roleRef: Invalid value"

docker - 如何在群体模式下通过流利的收集日志

java - Greenmail SMTP服务器无法作为自定义Docker镜像正常工作

mysql - Mongodb和Mysql哪个更适合存储图片链接和关键字

javascript - 当从数据库本身获取 modelObject 时, modelObject.save() 是否仅更新现有数据库文档?

linux - 每当我重新启动 docker/elk 图像时,数据就会丢失

linux - docker compose : Error while loading shared libraries: libz. so.1:无法从共享对象映射段:不允许操作

javascript - 如何在 mongodb 中将 $push 、 $set 和 $inc 放在一起?

ruby - 从哈希创建 Mongoid 文档