当前位置:   article > 正文

docker搭建mongo单机单节点副本集模式

docker搭建mongo单机单节点副本集模式

1.先说问题

现有如下问题:

1.在springboot环境下,连接mongo,报如下错误:

  1. Caused by: com.mongodb.MongoCommandException: Command failed with error 20 (IllegalOperation):
  2. 'Transaction numbers are only allowed on a replica set member or mongos' on server xxx:27017. The full response is {"ok": 0.0, "errmsg": "Transaction numbers are
  3. only allowed on a replica set member or mongos", "code": 20, "codeName": "IllegalOperation"}

2.在springboot环境下,连接mongo,报如下错误:

  1. MongoSecurityException: Exception authenticating MongoCredential
  2. {mechanism=SCRAM-SHA-256,......

后续解答这两个问题

2.编排docker-compose.yml

  1. version: '3'
  2. services:
  3. mdb:
  4. image: mongo:4.4.7
  5. restart: always
  6. container_name: mdb
  7. command: mongod --replSet repl --keyFile
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/696142
推荐阅读
相关标签
  

闽ICP备14008679号