本文主要是介绍docker搭建mongo单机单节点副本集模式,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.先说问题
现有如下问题:
1.在springboot环境下,连接mongo,报如下错误:
Caused by: com.mongodb.MongoCommandException: Command failed with error 20 (IllegalOperation):
'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
only allowed on a replica set member or mongos", "code": 20, "codeName": "IllegalOperation"}
2.在springboot环境下,连接mongo,报如下错误:
MongoSecurityException: Exception authenticating MongoCredential
{mechanism=SCRAM-SHA-256,......
后续解答这两个问题
2.编排docker-compose.yml
version: '3'services:mdb:image: mongo:4.4.7restart: alwayscontainer_name: mdbcommand: mongod --replSet repl --keyFile
这篇关于docker搭建mongo单机单节点副本集模式的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!