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
54
votes
3 answers
What is the difference between ReplicaSet and ReplicationController?
From what I can tell in the documentation, a ReplicaSet is created when running a Deployment. It seems to support some of the same features of a ReplicationController - scale up/down and auto restart, but it's not clear if it supports rolling…

David Knell
- 997
- 1
- 9
- 10
42
votes
2 answers
Mongo DB - difference between standalone & 1-node replica set
I needed to use Mongo DB transactions, and recently I understood that transactions don't work for Mongo standalone mode, but only for replica sets
(Mongo DB with C# - document added regardless of transaction).
Also, I read that standalone mode is…

Metheny
- 1,112
- 1
- 11
- 23
37
votes
5 answers
How to check secondary is synced now or not
there is the replica with three member (primary,secondary,secondary).
Suppose one of secondaries down for a day, after return secondary back to replica how can i find, is it synced yet or not?
I did that in testing environment, But couldn't find…

irmorteza
- 1,576
- 3
- 19
- 32
32
votes
5 answers
How to convert a MongoDB replica set to a stand alone server
Consider, I have 4 replicate sets and the config is as follows:
{
"_id": "rs_0",
"version": 5,
"members" : [
{"_id": 1, "host": "127.0.0.1:27001"},
{"_id": 2, "host": "127.0.0.1:27002"},
{"_id": 3, "host": "127.0.0.1:27003"},
{"_id": 4,…

Amol M Kulkarni
- 21,143
- 34
- 120
- 164
26
votes
2 answers
MongoDB Connection String to Replica Set
I am looking at http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html and when you scroll to the section "A replicaset connect using no acknowledgment by default and readPreference for secondary"
it stated a connection string…

Mark Thien
- 1,108
- 2
- 22
- 35
25
votes
7 answers
Mongo container with a replica set with only one node in docker-compose
I want to create a Docker container with an instance of Mongo. In particular, I would like to create a replica set with only one node (since I'm interested in transactions and they are only available for replica sets).
Dockerfile
FROM mongo
RUN echo…

StackUser
- 1,530
- 3
- 13
- 17
20
votes
2 answers
MongoDB change stream replica-set limitation
What is the reasoning behind only making change streams available on replica sets?

Daniel F
- 13,684
- 11
- 87
- 116
19
votes
1 answer
MongoDB replica set with simple password authentication
I have a MongoDB replica set of 3 servers (1 primary, 1 secondary, 1 arbiter; this is the default replica set created by Google Cloud 1-click install). The 2 config files (mongod.conf) of primary server and secondary server have been changed with…

Dee
- 7,455
- 6
- 36
- 70
15
votes
5 answers
MongoDB Replica Set : Cannot use non-local read concern until replica set is finished initializing
I tried to create a replica set following instruction such as : https://hevodata.com/learn/mongodb-replica-set-3-easy-methods/
Sadly, I have a problem at the first step :
Problem
The command :
mongod --port 27017 --dbpath "C:\Program…

Macab
- 151
- 1
- 1
- 4
14
votes
1 answer
Connecting to MongoDB Atlas using Golang mgo: Persistent no reachable server to replica set
I have a replica set from MongoDB atlas, to which I can connect with ANY other language, and regular mongo client, with the URL provided with the format…

hece
- 364
- 2
- 15
14
votes
4 answers
Mongoose connection to replica set
I tried to connect to MongoDB replicaSet via mongoose. I used this link.
Configuration json:
"mongoose": {
"uri": "mongodb://localhost:27022/chat,localhost:27021,localhost:27020",
"options": {
"replset": { "rs_name": "rs0" },
…

lor1an
- 654
- 2
- 6
- 14
13
votes
3 answers
Number of active connections on the server reached to max
I am working with mongodb and nodejs. I have mongodb hosted on Atlas.
My backend had been working perfectly but now it is sometimes getting stuck and when I see the analytics on mongodb atlas it shows maximum number of active connections reached to…

Profer
- 553
- 8
- 40
- 81
13
votes
5 answers
MongoDB Replica Set Member State is "OTHER"
Three members, primary & secondary - and a third one that's "OTHER" - I can't find any info on that state, not sure what to do, I've restarted the instance, but it always comes-up the same. Can find no documentation on that state.
I'm new to replica…

Jolly
- 349
- 1
- 2
- 9
13
votes
1 answer
MongoDB: Can't initiate replica set; 'has data already, cannot initiate set'
I've got a MongoDB instance, set up using a config file and a key file.
I'd like to initiate a replica set using pymongo. When I attempt to initiate the replcia set, by executing a python script against the server which will become the replica set…

Mr.Budris
- 552
- 5
- 21
13
votes
3 answers
Error while adding a secondary instance in mongodb replica set
I am trying to deploy mongodb replica set . I have made my mongodb instance as primary of the replica . Now i am trying to add another mongodb instance hosted at different iP address, as secondary of the replica, but i am getting the following error…

Anuj Jain
- 245
- 1
- 2
- 5