Questions tagged [mongodb-replica-set]

MongoDB's replica set uses redundant nodes to provide a high availability and resilience against network partitions of the primary node.

333 questions
0
votes
0 answers

nodejs driver - reconnect slow when PRIMARY GOES DOWN

I want to know how does nodejs driver behave when PRIMARY GOES DOWN. Issue db.shutdownServer() on Primary "SECONDARY" become Primary right away. But driver takes at least 11 second hanging before issuing another write command again. I test with…
0
votes
1 answer

Read from mongodb secondary node when no connection with primary

We have mongodb replica set with 3 instances, where Primary is in datacenter D1, and secondary nodes on datacenter D2. We dont need any failover option in our setup, and configured it as described at…
0
votes
2 answers

Mongodb architecture and failover with two data centres

I’m trying to figure out whether there is a way to seamlessly failover a mongo replicaset where most of the mongodb nodes live in the primary data centre. My current limitation is 2 data centres and third datacentre is out of the question. The issue…
0
votes
1 answer

pymongo replicaset NetworkTimeout error

I'm using the following connection string with my MongoClient on pymongo 3.4.0: client = MongoClient("mongodb://username:password@10.0.5.170:27017,10.0.5.222:27017,10.0.6.16:27017/?replicaSet=enterprise", connect=False) when I take down my primary…
masterforker
  • 2,443
  • 2
  • 25
  • 39
0
votes
1 answer

Ignore dropDatabase command on hidden backup replica?

I'm running a hidden, priority 0 replica server as backup. I was wondering if it is possible to ignore commands like dropDatabase and removeJournalFiles on the backup server? In my case it's safe to assume the backup server should not delete any of…
Blizz
  • 8,082
  • 2
  • 33
  • 53
0
votes
1 answer

pymongo ReplicaSet username password

I'm using the following syntax to establish a connection to my replica set: from urllib.parse import quote mongo_client = pymongo.MongoClient(host=[ quote('username:password@ipaddress1:27017'), …
masterforker
  • 2,443
  • 2
  • 25
  • 39
0
votes
1 answer

Unable to start mongod server with default oplog size while trying replication

I was unable to create replication, i.e. rs.initiate() when oplog was having default value. My server had 400+ GB of space available. In MongoDB's official documentation default range for MMAP is 5% of free disk space between 990MB to 50GB but here…
surbhi bakshi
  • 160
  • 1
  • 1
  • 17
0
votes
1 answer

Start mongod with overrided configuration for replSet

I have few mongoDB instances running as replication set. For each of them, I have prepared configuration file with replSetName, so starting mongo by mongod without -replSet is still adding it to replication set. But, to maintenance instance, I need…
rzysia
  • 737
  • 1
  • 11
  • 26
0
votes
1 answer

C++ Legacy Driver mongoDB Replicaset in Class of a DLL

I have built a dll which includes a class implementing the mongoDB replicaset operations. Here is a summary of the class. #include "mongo/client/dbclient.h" mongoimp::mongoimp() { mongo::client::initialize(); } mongoimp::~mongoimp() { …
Harold
  • 33
  • 5
0
votes
1 answer

PRIMARY is transitioning to RECOVERING after restart

I have a three-node replica set (1 Primary, 1 Secondary, 1 Arbiter), on three different Amazon server instances. The servers where they are hosted required a memory upgrade so I needed to shut down the MongoDB instances as well. I shut down the…
Dhanu R
  • 1
  • 1
0
votes
2 answers

Remote nodes not reachable in a three-node replica set

I have two PCs with IP addresses 10.1.1.52 and 10.1.1.11. I want to configure mongo replication (without sharding) with one primary and one secondary node running on 10.1.1.52 and one secondary node running on 10.1.1.11. I have followed these…
Sidd
  • 11
  • 3
0
votes
2 answers

Mongo Replicaset configuration from JAVA

Is it possible to configure Mongo Replica-sets from JAVA application? Are there JAVA APIs for rs.initiate(), rs.add(), etc? I am looking to configure mongo replica-sets from applications without the need to log into mongo console manually. Are…
Nataraj
  • 379
  • 7
  • 18
0
votes
1 answer

MongoDB Replicaset Primary failure

I am exploring MongoDB replica-sets and I would like to know how to handle fail-over from the application. Following is my scenario: Lets assume I have a replica-set with three nodes, say A(Primary), B(Secondary) and C(Secondary). 1.From my…
Nataraj
  • 379
  • 7
  • 18
0
votes
1 answer

Unable to addShard in MongoDB

I am trying to deploy mongodb sharding. I have deployed a replica set in three machines. However, I still can't seem to make it work when I try to sh.addShard("test/mongodb1.example.net:27017") to all the three nodes. The error shown…
stackyyflow
  • 767
  • 3
  • 11
  • 30
0
votes
0 answers

Node server crash with mongo replica connection

I am connecting with my mongo replica set using the set of code var mongojs = require('mongojs'); var replicationSet = "primary:27017,secondary:27017"; var replicaSetName = "rs"; var readPreference = "nearest"; var…