MongoDB's replica set uses redundant nodes to provide a high availability and resilience against network partitions of the primary node.
Questions tagged [mongodb-replica-set]
333 questions
1
vote
1 answer
Poor Write perfomance with MongoDB 5.0.8 in a PSA (Primary-Secondary-Arbiter) setup
I have some write performance struggle with MongoDB 5.0.8 in an PSA (Primary-Secondary-Arbiter) deployment when one data bearing member goes down.
I am aware of the "Mitigate Performance Issues with PSA Replica Set" page and the procedure to…

FrVaBe
- 47,963
- 16
- 124
- 157
1
vote
0 answers
how to auto update collection using mongoose
I want to auto update isActive field to false if timing.from is less than Date.now() and then filter out all those docs whose isActive is false.
This can be achieved by mongodb-replica-sets. But it's not auto updating.
Here is my code:
const schema…

Shubham Maheshwari
- 118
- 1
- 13
1
vote
1 answer
MongoDB replicaset external access - keep getting internal cluster names
I must be doing something terribly wrong. I have a replicaset configured using the MongoDB community operator, deployed in GKE, and exposed via LoadBalancers.
This replicaset has 3 members. I have defined the replicaSetHorizons like so:
…

jsy
- 71
- 6
1
vote
1 answer
MongoDB - how to set cluster?
My OS = Windows 10.
I have installed 2 MongoDB servers (Community Ed.) on 2 machines in LAN.
How can I set cluster (replica, shards) using these 2 MongoDB?

ZedZip
- 5,794
- 15
- 66
- 119
1
vote
1 answer
Docker Run MongoDB replica set.., how is it working?
So I'm creating some softwaare that makes heavy use of mongo transactions.
So far, I've tried only with testcontainers mongo, and pure unit testing.
Now I'm moving to test it manually and I get an error that says something like: Transaction numbers…

caeus
- 3,084
- 1
- 22
- 36
1
vote
0 answers
approach to migrate mongodb using mongomirror using 2 GCE only
approach to migrate mongodb using mongomirror: Setting up mongodb instace on GCE and then migrate to another on GCE only
setting up 2 GCE on same project
Installed mongodb on both GCE
Installed mongomirror on source vm1
Tried exeuting mongomirror…

Mohammed Sahil
- 9
- 2
1
vote
1 answer
Application deployed to Docker Swarm is not connecting with MongoDB Replica Set
I have deployed my application using Docker Swarm with 3 machines.
MongoDB Replica Set is configured manually and its working as a service on Ubuntu machine.
I am trying to connect to my Backend application to MongoDB Replica Set but I am getting…

Muhammad Tariq
- 3,318
- 5
- 38
- 42
1
vote
1 answer
MongoDB error on Transaction w/ ReadPreference Secondary on a test replica set
tl;dr How can I enable read preference SECONDARY on a single-operation read transaction, on a testing replica set?
I have created a MongoDB replica set from MongoDB deploy replica set for testing.
Then tried to make a simple, single-document…

Am4teur
- 125
- 1
- 9
1
vote
0 answers
Mongodb replicaset secondaries showing not reachable/healthy and lastHeartbeatMessage shows No connection could be made
Mongodb replicaset secondaries showing not reachable/healthy. It was working fine once the machine restarted it shows both secondary as reachable/healthy. I configured first secondary in the port 27027 and second secondary in 27037. When i Checked…

rakesh pakkam
- 144
- 11
1
vote
3 answers
docker mongo for single (primary node only) replica set (for development)?
This is the portion of the dockerfile that has served us well to date. However, now I need to convert this to be a single node replica set (for transactions to work). I don't want any secondary or arbiter - just the primary node. What am I…

Mike
- 609
- 12
- 36
1
vote
1 answer
How to connect specific secondary node in MongoDB Replica Set
I configured cluster with 2 secondary node. So, totally 3 node(1 primary, 2 secondary). My intention is to dedicate one of the secondary node to an application for read only.
But, i could not find the connection property to achieve this. Can anyone…

Ganesan G
- 59
- 7
1
vote
0 answers
MogoDB - Query has become extremely slow on a PSA replicaset
I have a MongoDB replica set with one primary, one arbiter, one vote bearing secondary, and two no vote bearing secondary servers.
The two non-vote bearing secondaries are bare metal mongo installs to help with heavy aggregation queries. (each…

Ylli Prifti
- 323
- 3
- 11
1
vote
1 answer
What's the equivalent of `rs.slaveOk()` for config file in MongoDB?
I have set up my MongoDB on local machine with replicaSet, and I have this error:
An error occurred while loading navigation: 'not master and
slaveOk=false': It is recommended to change your read preference in
the connection dialog to Primary…

ezio4df
- 3,541
- 6
- 16
- 31
1
vote
1 answer
Unable to access MongoDB replicaset inside Docker Container from remote client
I have setup a mongoDB Replicaset (3-repicas) inside Docker Container. I am able to access the replicateset from host machine but unable to access the mongoDB Replicaset from a remote client.
Reference:…

RajKrishnan
- 149
- 4
- 16
1
vote
1 answer
Allowed to connect without authentication and read only users can write in MongoDB
I had to create a new user in a MongoDB Server and grant it read-only permissions to a single database. Note that I am not the administrator here.
I connected with my user and executed the following code:
db.createUser({user: "newuser", pwd:…

Victor Ferreira
- 6,151
- 13
- 64
- 120