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
5
votes
3 answers
Prisma + MongoDB -> Replica set
Error Invalid "prisma.user.create()". Prisma needs to perform transactions, which requires your MongoDB server to be run as a replica set.
I used Nx (nx.dev) with MongoDB/Express with Prisma.

Baalamurgan
- 211
- 3
- 8
5
votes
1 answer
How to make MongoDB `repairDatabase` and `compact` commands work with replica-set? Downtime is ok
We need to free some of our MongoDB space, and we identified 100Gb + worth of documents that can be safely removed from a collection.
So we removed them from our test environment which has this setting:
mongodb version 3.0.1
no sharding
1 node, no…

Mario Trucco
- 1,933
- 3
- 33
- 45
5
votes
4 answers
MongoDB primary stepDown does not succeed
Setup: replica set with 5 nodes, version 3.4.5.
Trying to switch PRIMARY with rs.stepDown(60, 30) but consistently getting the error:
rs0:PRIMARY> rs.stepDown(60, 30)
{
"ok" : 0,
"errmsg" : "No electable secondaries caught up as of…

Dmitry
- 51
- 1
- 4
5
votes
1 answer
MongoDB initial sync on a large database
We are using a MongoDB replica set with three nodes. The database is quite large 2+ billion records and occupies 700GB on a disk (WiredTiger MongoDB engine). Mostly on documents are performed inserts (several millions per day) and after that reads…

ssasa
- 1,616
- 1
- 18
- 30
5
votes
0 answers
How to start mongoDB with replicaSet by config file on Ubuntu 14.04.4
Hi I've configured MongoDB with a replicaSet. If i run the command:
sudo mongod --replSet "rs0"
Everything works and the 3 replicas work, but if i run the command:
sudo mongod --config /etc/mongod.conf
It doesn't work, the shell doesn't display…

Graziano Dimatteo
- 197
- 3
- 14
4
votes
0 answers
Cannot configure a Mongo replicaSet from docker init script
I am trying to set up a 2 node replicaSet in docker for local development only. Single node already works fine, but there are keyfile issues when trying to add a member as part of the docker init script (NB I see the keyfile is set correctly from…

James Williams
- 43
- 5
4
votes
1 answer
What if arbiter goes down?
I'm going to setup a mongodb replica set consisting of primary, slave and arbiter nodes. And I wonder what will happened if arbiter node goes down? Maybe somebody had such an experience.

kmpfwgn
- 43
- 6
4
votes
1 answer
MongoDB standalone vs replica set and how to migrate data from a standalone to a replica set
I have a few questions about MongoDB standalone and Replica sets, I don't really get it.
When should I use either of them
Why all the replica sets tutorials show 3 connections, is there a reason?
Can I create a replica set for 1 instance only? and…

Ali Elkhateeb
- 3,413
- 4
- 21
- 39
4
votes
1 answer
mongodb client libraries fail to connect to replica set
Using recent client libraries (pymongo 3.4, mongodb (nodejs) 2.2.27), I am having trouble connecting to my mongodb servers with replication.
The replicaset configuration contains either the internal ips of the servers or the hostnames. I'm getting…

njLT
- 464
- 6
- 21
4
votes
2 answers
Exposing mongodb on kubernetes statefulsets to external world
I have setup the mongodb replicaset on kubernetes with Statefulsets using this helm chart
I can access the mongo instance inside the cluster. But I'd like to open it for access to the external world. I tried two approaches to accomplish it
Create…

Srikanth
- 125
- 2
- 11
4
votes
1 answer
error while trying to stepdown mongodb replica set
Setup:
1 primary, 3 secondaries and 1 arbiter (All 5 are running.)
When I'm doing a stepDown() in primary, getting the below error in the shell -
m101:PRIMARY> rs.stepDown()
2017-06-07T15:01:21.357 E QUERY [thread1] Error: error doing query:…

Van Peer
- 2,127
- 2
- 25
- 35
4
votes
0 answers
Timeout connecting to MongoDB 3.2
I'm using .NET Driver version 2.2.4 (application using .NET 4.5) to connect to MongoDB version 3.2 and I'm receiving some timeout exceptions.
Scenario detail: We have a ReplicaSet with 2 servers, and one of the servers also has an arbiter running at…

Tiago Santos
- 43
- 5
4
votes
1 answer
mongo: ERROR: child process failed, exited with error number 100
I successfully created a replica set of three instances on mongodb. Each member of the replica set is instantiated using a config file. When I tested it, everything went well, and executed successfully without any errors.
The next step, which is…

Nicolas
- 91
- 2
- 6
4
votes
2 answers
Locked outside mongodb replica set
I have a mongodb replica-set of 3 members (version 2.4) in which the administrator user for the 'admin' db does not have the 'userAdminAnyDatabase' role.
This role is required for managing the users on all databases.
The roles I currently have are:…

odedfos
- 4,491
- 3
- 30
- 42
3
votes
1 answer
MongoDb replica set in a single image fails in GitLab CI/CD due to ReplicaSetGhost
I am struggling with MongoDb 6 Replica Set and automated testing in CI/CD.
I have created a single docker image with a Replica Set for development and testing purposes.
This works well when running the docker container locally and running my tests…

diegosasw
- 13,734
- 16
- 95
- 159