This tag is used mostly for a MongoDB replica set (a group of "mongod" processes that maintain the same data set) and rarely for a Kubernetes ReplicaSet (the next-generation Replication Controller with set-based selector support).
Questions tagged [replicaset]
583 questions
13
votes
3 answers
errmsg" : "No host described in new configuration 1 for replica set rs0 maps to this node", Why I am getting this message?
I am getting this message every time I do rs.initiate() :
No host described in new configuration 1 for replica set rs0 maps to this node
This is how my /etc/hosts/ file looks on both the replica set servers.
Server 1 and server 2 "hosts"…

Shashank
- 149
- 1
- 2
- 6
11
votes
1 answer
What is the difference between a cluster and a replica set in mongodb atlas?
I'm taking the Mongodb University M103 course and over there they gave a brief overview of what a cluster and a replica set is.
From my understanding a cluster is a set of servers or nodes. While a replica set is a set of servers or nodes all of…

Devorein
- 1,112
- 2
- 15
- 23
11
votes
3 answers
How to set rs.slaveOk() in secondary mongodb servers in replicaset via commandline?
How to set rs.slaveOk() in secondary mongodb servers in replicaset via commandline?
I tried following methods :
${MONGO_HOME}/bin/mongo --port ${MONGO_PORT2} --host ${MONGO_SECONDARY2} --eval "printjson(rs.slaveOk())"
${MONGO_HOME}/bin/mongo --port…

NitheshKHP
- 381
- 1
- 2
- 13
11
votes
4 answers
Single Instance Mongodb Replica Set - cannot perform query/insert operations
After installing mongodb, I ran mongod with
mongod --dbpath --logpath --replSet rs0
I then connected with the mongo shell and ran
rs.initiate()
I then tried to insert a document into a collection, but received an error:
>…

d0c_s4vage
- 3,947
- 6
- 23
- 32
10
votes
3 answers
MongoDB Error: Unable to reach primary for set [set_name] when connect to mongo replica set
I'm trying to connect to MongoDB replica set consists of 3 mongo docker-container, but Error Message: Unable to reach primary for set rs0 occurs.
Git Repository: https://github.com/frontalnh/mongodb-replica-set
I made docker swarm consists of 3…

Namhoon Lee
- 158
- 1
- 2
- 11
10
votes
1 answer
How to handle pymongo AutoReconnect exception with insert_many method
I have a MongoDB replica set with 3 members and a Python application which stores data in it.
I can handle pymongo's AutoReconnect exception when using single document inserts with a wrapper as follows:
def safe_mongo_call(method, num_retries,…

Tomáš Linhart
- 9,832
- 1
- 27
- 39
10
votes
1 answer
"This node was not started with the replSet option"
I am studying the MongoDBUniversity's M101P: MongoDB for Developers course.
I am using WiredTiger on MongoDB 3.2.
I am currently on the topic of replica sets.
The course requires I create a replica set using the following code:
mongod…

Jake Stokes
- 445
- 1
- 5
- 17
10
votes
4 answers
mongodb : could not find member to sync from
I'm fairly new with mongodb
I have a replica set 3 nodes
1 primary (A)
1 secondary (B)
1 Arbiter (C)
The replica set was created using MMS
the 3 node are in 3 different cities
I keep on getting the following error on the secondary that last for lest…

Philippe Courtois
- 171
- 1
- 1
- 5
10
votes
2 answers
Connection to MongoDB replica set takes a minute+ in PHP when a secondary is unreachable
I have a replica set consisting of 5 members: primary+arbiter on server 1, secondary+arbiter on server 2, hidden secondary (backup node) on server 3.
I expect this configuration to work if one server goes down or loses connectivity…

mephisto123
- 1,400
- 13
- 38
10
votes
2 answers
How to determine ops cause getMore operations on a MongoDB server
I am seeing the following in mongostat on the primary server in my replicate set:
insert query update delete getmore command flushes mapped vsize res faults locked db idx miss % qr|qw ar|aw netIn netOut conn set repl time
…

Ben Zittlau
- 2,345
- 1
- 21
- 30
9
votes
6 answers
Replicaset doesnot update pods in when pod image is modified
I have created a replicaset with wrong container image with below configuration.
apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
name: rs-d33393
namespace: default
spec:
replicas: 4
selector:
matchLabels:
name:…

Sravan Kumar
- 93
- 1
- 5
9
votes
2 answers
pymongo unable to connect to primary
I'm trying to find_one by connecting to my replica set's primary node.
MongoClient(hostname, replicaSet="rs0", read_preference=ReadPreference.PRIMARY)
But it results in an error:
ServerSelectionTimeoutError: No replica set members match selector
…

Green Cell
- 4,677
- 2
- 18
- 49
9
votes
2 answers
Mongodump with Replica Set : how to force on secondary?
I have a strange problem with my MongoDB Replica Set backup. I have 2 servers (one primary and one secondary) and I run a backup task every 2 hours.
I use this: mongodump.exe --db MyBase --out "d:\Backups"
But, when I run this backup, my client…

Fred Mériot
- 4,157
- 9
- 33
- 50
9
votes
1 answer
How can I connect a mongodb replicaset using mongoengine?
I'm trying to connect to a MongoDB replicaSet using MongoEngine? I would like to connect to any available secondary server.
I can only find pyMongo examples. Any help?

rat
- 1,277
- 16
- 24
8
votes
1 answer
Enabling MongoDB transactions without replica sets or with least possible configuration
[Some background information - possibly skippable]
To begin with, I have barely any understanding of database management
and just shallow experience with mongoose and node in the backend
realm(a couple of udemy courses). Udemy courses made me…

fly
- 121
- 1
- 7