Questions tagged [mongodb-replica-set]

MongoDB's replica set uses redundant nodes to provide a high availability and resilience against network partitions of the primary node.

333 questions
2
votes
0 answers

MongoDB - Large Volume Data Archival and Oplog Size

I have a request of periodical data archival of a large collection. A few points of the requirement is causing some concerns from me: Data archived should be moved into a different database for equal application access as production. The frequency…
Lee
  • 2,874
  • 3
  • 27
  • 51
1
vote
0 answers

Primary mongo node still trying to reach arbiter after removing it

we faced issue regard replication of MONGO replicSet on production so I rebuild the replica set by deleting the local DB and initate it again with just primary node so production application can be up until we solve it. i deleted the local db from…
1
vote
0 answers

docker-compose, mongodb and replica set. I'm unable to connect to the database

I'm trying to run a single mongodb instance in replica set mode to enable the use of transactions. I have the following docker-compose.yml: version: "3.7" services: mongo: container_name: mongo-database image: mongo:6.0.4 restart:…
Magus
  • 14,796
  • 3
  • 36
  • 51
1
vote
3 answers

CQRS vs Database replica set

I have one confusing point over CQRS(Command and Query Responsibility Segregation) pattern. As we know, in CQRS the read and write operations should happen on separated databases. And in the application level, we need to sync data to read database…
Chris Bao
  • 2,418
  • 8
  • 35
  • 62
1
vote
0 answers

(MongoSocketOpenException): Exception opening socket | Unknown host: wisdb1

I tried to connect MongoDb replica-set (3 nodes) with docker. This is my docker-compose file, i renamed all services from e.g. "mongo1" to "mongoa1" because i have a second app with the same config file: version: "3.8" services: mongoa1: …
user19540948
1
vote
2 answers

MongoDb Replica Set write concern issues on Secondary IP, while Primary IP is Shutdown

I am using three nodes for my MongoDB replica set, one as the primary node, one as a secondary node, and one as an arbitrator node. I am using the following connection string in Golang to connect with MongoDB. opts =…
rohit
  • 89
  • 5
1
vote
0 answers

Error code 18 AuthenticationFailed when add Secondary in replica set MongoDB

I received the error below: {"t":{"$date":"2022-12-24T11:00:54.895+00:00"},"s":"I", "c":"NETWORK", "id":4712102, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"Host failed in replica…
1
vote
0 answers

Why did writes stop working when a secondary in my replica set went down?

I have a MongoDB replica set with 3 nodes and 1 arbiter. The nodes have priority 0, 1, and 10. The arbiter has priority 1. They all have 1 vote. The priority 10 was PRIMARY, while the priority 0 and 1 were both SECONDARY. I set the default write…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
1
vote
1 answer

MongoDB returns different values from count() and find() for same filters

I am running a MongoDB 6.0.3 replica set. I have a collection of products and I want to get the count of products matching my filters. However, when I run find(), I get about 23 results returned, but when I run count(), I get a count of 706 matching…
blizz
  • 4,102
  • 6
  • 36
  • 60
1
vote
1 answer

Connect to mongodb replicaset in kubernetes with external access enabled

I have deployed a mongodb replicaset (v6.0.2) using this chart: bitnami/mongodb 13.3.1 I have enabled external access with SVC type LoadBalancer. I have my DNS records pointing to each external SVC IP. mongodb-0.dev -> 10.246.50.1 mongodb-1.dev ->…
mrk
  • 640
  • 8
  • 16
1
vote
0 answers

How to connect to replica set when you have multiple CA certs

I have deployed the replica set with servers on 3 different VMs each one having it's own certificate Key file and CA file, I am looking for a connection string that allows me to pass multiple certificate files unique to each server The service is…
pramod
  • 11
  • 2
1
vote
0 answers

Error deploying mongodb replica set locally

I'm trying to deploy a mongodb replica set when I run my integration tests, but I get the error below: Failed to connect to DB {"error": "error ping-ing mongo: connection() error occurred during connection handshake: auth error: sasl conversation…
jbone
  • 71
  • 3
1
vote
1 answer

MongoDB: Global read preference (set via connection string) vs Query level read preference (set as options in query), which takes precedence?

I am running a mongoDB cluster. A nodejs application connects to this db and I have set readPreference= secondaryPreferred. However there is one critical flow which writes the document and then subsequently reads the same document. While we read it,…
Shiva
  • 543
  • 1
  • 6
  • 20
1
vote
1 answer

Expose MongoDB single-node replica set inside docker-compose to host on macOS

I have this docker-compose file: version: "3" services: mongo: image: bitnami/mongodb:4.4 restart: always ports: - 27017:27017 volumes: - ./db:/bitnami/mongodb environment: -…
tyteen4a03
  • 1,812
  • 24
  • 45
1
vote
1 answer

deploy mongodb with helm - why does it connect only the primary pod to replica set?

using the following command: helm install mongodb bitnami/mongodb --set mongodbRootPassword=root --set mongodbUsername=myapp --set mongodbPassword=myapp --set mongodbDatabase=mydb --set replicaSet.enabled=true --set auth.enabled=false --set…
pizza_pasta
  • 87
  • 1
  • 7