MongoDB Replication MongoDB Replication
In this video we will see how to setup MongoDB replication on Windows environment.
In this video we have setup replication on three member servers.
We can perform read and write operations only on Primary replica server.
On secondary servers read only operations performed.
If we try others then MongoDB will through error.
mongod --dbpath C:Program FilesMongoDBServer4.0data --logpath C:Program FilesMongoDBServer4.0logmongod.log --port 27017 --storageEnginewiredTiger --journal --replSet r2schools
mongod --dbpath C:data1db --logpath C:data1logmongod.log --port 27020 --storageEnginewiredTiger --journal --replSet r2schools
mongod --dbpath C:data2db --logpath C:data2logmongod.log --port 27021 --storageEnginewiredTiger --journal --replSet r2schools
Actions performed on Primary Server.
rsconf_id:r2schoolsmembers:_id:0host:localhost:27017
rs.initiatersconf
rs.addlocalhost:27020
rs.addlocalhost:27020
rsstatus
On Secondary Servers run below commands
rs.slaveOk
rsstatus
MongoDB Tutorials
How to setup MongoDB Replication on windows
MongoDB Replication Setup
Setup MongoDB Replication on windows
MongoDB Replication Setup on Windows
Step by Step MongoDB Replication Setup on Windows
Step by Step MongoDB Replication Setup
How to configure MongoDB Replication on Windows
MongoDB Replication Tutorial
MongoDB Tutorial for beginners
MongoDB Tutorial
MongoDB Replication
Источник: rutube.ru