Downgrade MongoDB replica set to a standalone node

Remove secondary member nodes

rs.remove("127.0.0.1:27027")
rs.remove("127.0.0.1:27037")

Remove replication setting

#replication:
#replSetName: rs0
mongod --port 27017 --dbpath="C:\data\db0"
use localdb.system.replset.remove({})
db.replset.election.drop()db.replset.minvalid.drop()

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Quickly and Automatically Build Container Images Using Serverless Kubernetes and Kaniko

Cloud Landing Zone Lifecycle explained!

Building a Serverless Application on Alibaba Cloud (Part 1)

Flutter Hive complex objects in database (typeAdapter), and how to save objects

How to Install Newer Software in Debian or Ubuntu

Practical Exercises for Docker Compose: Part 1

Building an End-to-End IoT “Thing Model” on Alibaba Cloud

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adela Chao

Adela Chao

More from Medium

Introduction to Node JS

Exploring Node.js

How to create a REST API using Koa js, Node js and Mongo DB

Features of Solidity