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
2 answers
In which state a MongoDB replica set node ends if it cannot find a majority during a primary election?
Let's consider a MongoDB replica set composed of three nodes (Node 1 being the primary, Node 2 and 3 being secondaries) and a network partition occurs, so Node 1 lose connection to 2 and 3 (but 2 and 3 are connected each other).
So, at the end…

fgalan
- 11,732
- 9
- 46
- 89
1
vote
0 answers
Kubernetes MongoDB connection issue from Java
Good morning,
I deployed a MongoDB ReplicaSet cluster (3 nodes, 1 primary, 2 secondary) on Kubernetes using the following guide to do it:
Guide
Deploy it was successfully and I can connect by mongo shell to my remote MongoDB Cluster by user/pass,…

Juan Carlos Martin
- 15
- 8
1
vote
0 answers
Different realation between dataSize and storageSize in different databases
I am using MongoDB 4.0 and I have 2 different databases as below:
First one with this stats
"collections" : 527,
"views" : 0,
"objects" : 20512406,
"avgObjSize" : 145.463036271805,
"dataSize" : 2983796858.0,
"storageSize" :…

Mohammad Taherian
- 1,622
- 1
- 15
- 34
1
vote
1 answer
MongoDB Batch read implementation issue with change stream replica set
Issue:
A inference generating process is writing around 300 inference data's to a MongoDB collection per second. Change stream feature of MongoDB is utilized by another process to read back back these inferences and do the post-processing.…

Jerin
- 11
- 1
1
vote
0 answers
Replica Arbiter Set
I need to change my arbiter as AWS retiring my ec2 instance "Retiring: This instance is scheduled for retirement..."
So I need to change my arbiter server, I created a new server, added all the things that exist in that server as I already save AMI…

VIKAS KOHLI
- 8,164
- 4
- 50
- 61
1
vote
1 answer
MongoDB Cluster Shard with no primary and only one secondary active
My MongoDB Sharded Cluster has 3 shards with each shard running on 3 replicas. To summarize:
Config Server:
shardcfg1.server.com:27018
shardcfg2.server.com:27018
shardcfg3.server.com:27018
Shard1:
shard11.server.com:27000 (P)
…

Sarthak Sawhney
- 432
- 4
- 14
1
vote
0 answers
Cannot connect to uninitialized Replica Set with the Go driver
I'm trying to connect to a member of a future replica set in order to initiate the replica set with replSetInitiate using the official Go mongodb driver (not mgo).
I can connect fine to my instance using the mongodb shell but the same connection…

SBSTP
- 3,479
- 6
- 30
- 41
1
vote
1 answer
mongodb localhost replicasetup
I want to setup a replicasetup in my local machine,I am using to instances of mongodb(mongod1.conf,mongod2.conf), rs initiated mongo1 on port 27018 and i want to add the members to 27018 , rs.add('ThinkPad-X230:27019') it is throwing an error called…

venkatesh
- 141
- 3
- 13
1
vote
1 answer
how to automatically setup a dockerized mongo replica set?
i'm using this docker-compose.yml to run a local mongo replica set:
version: '3.5'
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo
expose:
- 27017
ports:
- 27017:27017
restart:…

2bis
- 55
- 11
1
vote
1 answer
Fetch mongo replicationInfo using Mongo Java client
I am fetching metrics about my mongo application and want to fetch replication oplog metrics using Mongo Java client.
From the terminal printReplicationInfo() command gives the required info. However I am not able to find it's equivalent to fetch…

RohitS
- 157
- 2
- 6
- 21
1
vote
2 answers
MongoDB primary replica failed before secondary replicas can sync themselves
My mongo db has three replicas 1 is the primary node and 2,3 is the secondary nodes.
Suppose the following sequence of event happens
1) Replica 1 writes document A and it is replicated to 2,3
2) Replica 1 writes document B but does not manage it to…

Ghazanfar Khan
- 3,648
- 8
- 44
- 89
1
vote
0 answers
No server chosen by WritableServerSelector from cluster description
I am trying to insert my application logs into MongoDB. I have created a custom appender and have overridden the append method as follows:
public void append(LoggingEvent loggingEvent) {
Document doc = convertToMongoDocument(loggingEvent);
…

Mickie16
- 11
- 3
1
vote
0 answers
failed with Server min and max wire version are incompatible (6,6) with client min wire version (0,5)",
want to implement master slave two ubuntu machine having same mongoshell version 3.4.19 but gives error "failed with Server min and max wire version are incompatible (6,6) with client min wire version (0,5)","
while rs.add("ip:port")

Uday Magdum
- 77
- 1
- 6
1
vote
1 answer
Configuring a MongoDB Cluster
I should configure a mongodb cluster with two nodes. Each node should have all data replicated. If one server die, the other should assume as primary.
Before I configure the cluster, I'm doing a local test using docker instances to configure it. As…

Victor
- 8,309
- 14
- 80
- 129
1
vote
3 answers
helm chart "stable/mongodb-replicaset" is stuck when 2nd pods bootstraps / is added to replicaset
Version of Helm and Kubernetes:
Kubernetes (GKE):
Client Version: v1.9.7
Server Version: 1.10.6-gke.2
Helm: 2.10.0
Server: v2.10.0
Which chart:
stable/mongodb-replicaset
What happened:
Summary: 1st Pod started correct. 2nd Pod is stuck at…

Mizaru
- 303
- 3
- 7