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
1
vote
1 answer

mongoDB replication failover not changing automatically from secondary to primary

I have setup 2 system with mongodb replication in ubuntu 16.4 , one is primary and another secondary, its working correctly but when the primary goes to down the secondary not comes as a primary, I have seted voting and priority using below commands…
shufilkhan
  • 521
  • 2
  • 6
  • 22
1
vote
0 answers

MongoDB replica set configuration crashed

Overview: I have a 3 member replica set configuration. 1 primary, 1 secondary and 1 arbiter. All 3 are running and are in perfect sync with each other. Problem: All the instances were stopped for server maintenance. They were started in the…
Kaustubh J
  • 11
  • 1
1
vote
0 answers

Spring Cloud Connector and MongoDB Replica Set

I have developed a micro service in Spring boot and it is deployed in Cloud Foundry. MongoDB is a service created in PCF and it is a replica set type service. The mongodb service is bound to the micro service in PCF. I am using Spring cloud…
1
vote
1 answer

Openshift: Endpoints/Service for External MongoDB: Error No server chosen by WritableServerSelector from cluster description

I am deploying my spring boot application in Openshift and the same uses external mongodb cluster for which I have created Endpoints/Service Objects. In my application.properties file I am using service name and when I try to call some API I am…
maverick
  • 1,458
  • 5
  • 20
  • 28
1
vote
0 answers

Spring Boot Mongo DB Replica Set not working as expected

In my project, I need to setup replica set for two mongo db instances. I did setup the mongo db in two different PCs to be primary and secondary and tested, it works fine. I connected this to Spring Boot and it shows the replica set is working…
Ragu
  • 51
  • 2
1
vote
1 answer

Migrating mongodb cluster - reelections

Consider you have to move your mongo cluster from one environment to another, with minimal downtime during the process. Let's say you have environment 1 (i.e AWS), with the following mongo nodes: mongo_aws_1 mongo_aws_2 mongo_aws_3 Your…
slnowak
  • 1,839
  • 3
  • 23
  • 37
1
vote
1 answer

MongoDB replica set on windows facing some basic issues

I am on Windows 10 Environment. I would like to Implement Replica Set on MongoDB. I am facing some issues.. For that, I cover almost many tutorials to implement the things on Windows Machine. I want to create a replica set consisting of a primary…
Ankit
  • 951
  • 1
  • 9
  • 29
1
vote
2 answers

Unable to run mongo container with replica set using docker-compose

Here's my docker-compose file: version: '3' services: mongo: hostname: mongo container_name: search_mongo image: mongo:latest volumes: - ./docker/local/persist/mongo:/data/db - ./docker/mongo:/opt/mongo ports: …
1
vote
0 answers

Mongodb data sync between primary and secondary node even when port is closed

I have configured mongodb replicaset in aws using 3 ec2's with one primary and 2 secondary nodes. When I insert data on primary node it is getting synced to the secondary nodes which it should. But when I close the port via security group still the…
1
vote
2 answers

Express can't connect to mongodb replica set when new primary get elected

I have a mongodb replica set with the following config: M1 primary M2 secondary M3 secondary M4 arbitrator Here is my Express code to connect to db (I use mongoose as the ODM): const config = { db:…
Justin
  • 4,400
  • 2
  • 32
  • 36
1
vote
1 answer

Mongodb - TypeError: ReplSetServers is not a function

I'm developing an app, which has mongodb as database. I'm using multiple URLs to connect mongodb. I have used following to connect DB. var mongoClient = require('mongodb').MongoClient; var Db = require('mongodb').Db; var Server =…
1
vote
1 answer

Cannot connect to MongoDB via NodeJS - No primary found in replica set error

I am having difficulty connecting to MongoDB via NodeJS. The Mongo setup consists of a shared cluster. The URL is…
jsmith
  • 89
  • 1
  • 15
1
vote
2 answers

How to connect vapor to mongodb atlas

So I have a vapor \ fluent app that works fine with local mongo instance, here's current mongo.json: { "database" : "vapor", "port" : "27017", "host" : "127.0.0.1", "user" : "", "password" : "" } I've deployed a free MongoDB…
Dannie P
  • 4,464
  • 3
  • 29
  • 48
1
vote
1 answer

Authorization fail to MongoDB Atlas from Node.JS

I am trying to connect to my mongoDB atlas cluster but get an authentication fail. I am able to connect from a client like Studio 3T and from the Mongo shell. Here's my connection URI: var conn =…
Passero
  • 222
  • 1
  • 10
1
vote
1 answer

MongoDB: Adding member to replica set triggers election in 3.2.11?

What are the scenarios that cause mongodb to trigger an election on rs.add()? In version 3.2.11, I have seen multiple times that adding/removing member to replica set does not trigger an election. Contrary, in version 2.6, most of the times on…
Atish
  • 4,277
  • 2
  • 24
  • 32