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
2
votes
1 answer
mongo replica set between local server and public server
Here is my situation:
I have a public server which allow users access from the internet, but the data is stored in a local computer. This computer can normally also connect to internet, but when the local system's internet connection is down I want…

Felix.Liu
- 21
- 2
2
votes
1 answer
Bitnami Mongodb ReplicaSet Set Issue on MS Azure - Secondary node late response
I have created Mongodb with Replica Set on Azure. I have rails application hitting replica set on public ip. My replica set have 1 primary and 2 secondary node. I am facing extreme lag in response from secondary nodes but very fast response from…

Ketan Ghumatkar
- 720
- 7
- 14
2
votes
1 answer
Disable read operation ont the slave member for a mongodb replicaset
rs.slaveOk() enables read operation on the slave member in a MongoDB replica set.
What function is used to disable it?

Fabrice Chapuis
- 448
- 1
- 5
- 19
2
votes
2 answers
MongoError: no valid replicaset members found
Can anyone explain in what scenario the below error occurs?
database error {
[MongoError: no valid replicaset members found]
name: 'MongoError',
message: 'no valid replicaset members found'
}
This is how I connect to the replica set:
var url =…

Prabhu Kathiresan
- 57
- 3
- 7
2
votes
1 answer
What role provides access to the Replica-Set status method (rs.status()) for MongoDB?
I would like to create a user that just has access to retrieve the status of our replica-set. Is there a built-in or other role that allows this? The docs do not seem to indicate what role is even needed to call any of rs. methods.

Nick
- 4,901
- 40
- 61
2
votes
2 answers
Read from secondary replica set in mongodb through javascript
I have 2 mongo instance running in 2 different servers (one primary and other secondary); I am able to retrieve a document from the primary server using this connection code:
var db = mongojs('user:pswd@localhost:27017/mydb?authSource=admin');
But…

Prabhu Kathiresan
- 57
- 3
- 7
2
votes
1 answer
How to setup a valid mongo replicaset
I would like to study a scenario that there are several MongoDB in replica mode but in a special case, there is only one working. My configuration is like following.
I have a MongoDB container on an EC2 instance, my command is
sudo docker run…

Bryan
- 1,477
- 1
- 21
- 38
2
votes
1 answer
Error initialising MongoDB replica set in Docker container
I have created a MongoDB docker container, with a replica set, using this command:
docker run -d --name mongo -v /data/db:/data/db mongo --replSet name
The container starts running.
I then try to initiate the replica set, using this…

sudhakar sudha
- 21
- 2
2
votes
1 answer
MongoDb Ops Manager can't start mongos and shard
I Came by a problem where i have an Ops Manager that suppose to run a MongoDB cluster as an automated cluster.
Suddenly the servers started going down, unexpectedly - while there are no errors in any of the log files indicating on when is the…

Eliran Efron
- 621
- 5
- 16
2
votes
0 answers
Pymongo doesn't use MongoClient defined IP addresses in Replica Set
I'm running a Kubernetes Cluster of MongoDB ReplicaSets.
I've initialized the replicaset just fine and everything is syncing with one another.
members" : [
{
"_id" : 1,
"host" :…

David C
- 3,659
- 5
- 34
- 46
2
votes
1 answer
Mongodb java client fails when Primary Server node changes in replicaset
Problem: MongoDB writes fail with the error -
Timed out after 30000 ms while waiting for a server that matches
PrimaryServerSelector. Client view of cluster state is
{type=REPLICA_SET, servers=[{address=intdb01:27017,
…

Master Chief
- 418
- 1
- 6
- 17
2
votes
2 answers
Mongodb eventual consistency on replica-sets when writing on two documents
We have a single client that serially writes on two documents (with {w:1}).
For example, the original documents may be:
{_id: "a", value: 0},
{_id: "b", value: 0}
and the client updates document "a" to {_id: "a", value: 1} and then, after the update…

Oren
- 2,767
- 3
- 25
- 37
2
votes
1 answer
MongoDB Initial Sync failing repeatedly (Mongodb 3.2 on Ubuntu 16.04 on Azure VM)
I have a one member mongod instance (Server1) with a very large DB with 2.5 million documents (Each document is very big) and 4 indices.
Then I added another machine (Server2)to this replica set. Mongod on Server2 takes about 5 hours to fetch all…

VaidAbhishek
- 5,895
- 7
- 43
- 59
2
votes
1 answer
AWS MongoDB cluster Provisioning through Ansible
We are deploying mongodb cluster through ansible on AWS EC2 instance.
Once a DB instance is provisioned, we give it corresponding tag for Primary / Secondary. We have 3 nodes - 1 for Primary and 2 for secondary.
While running the ansible scripts for…

Deepak Chaudhry
- 219
- 4
- 12
2
votes
1 answer
Mongo read only sync database
I have a replicaSet of mongo running , I just want to have another read only clone of same replicaSet(slave) ,with all the data in it is in sync with replicaSet(master). I had come across a solution available here . But could not exactly figure out…

Prateek
- 299
- 3
- 18