banner



How To Create Replica Set In Mongodb

Create a MongoDB replica set in Windows

Add replication options into MongoDB config file

                      replication:
oplogSizeMB: <int>
replSetName: <string>
enableMajorityReadConcern: <boolean>
                      replication:
replSetName: rs0

Catechumen a standalone case to a replica set

          mongod --port 27017 --replSet rs0 --dbpath="C:\data\db0"        

          rs.initiate()        

Add new members to the replica fix

          mongod --port 27027 --replSet rs0 --dbpath="C:\data\db1"        
          mongod --port 27037 --replSet rs0 --dbpath="C:\data\db2"        
          rs.add( { host: "127.0.0.i:27027", priority: 0, votes: 0 } )        

          rs.add( { host: "127.0.0.1:27037", priority: 0, votes: 0 } )        

Check replica set up status

          rs.status()        

How To Create Replica Set In Mongodb,

Source: https://adelachao.medium.com/create-a-mongodb-replica-set-in-windows-edeab1c85894

Posted by: reinhardtdomse1987.blogspot.com

0 Response to "How To Create Replica Set In Mongodb"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel