Monday, February 13, 2017

Wconcern - Replication - Best practice

Best practice

Write concern -> wmajority setting is important
Wtimeout value should be appropriate to ensure taking Write ackg within timeout interval
Connection pool max size should be appropriate

Wednesday, February 1, 2017

Replication failover




FAILOVER
=========

ps  -Aef|grep mongod
Ps -Aef|grep mongod|grep <pid>    ---- belongs to primary instance port id
kill  -9   <pid>
rs.slaveOk() for making the secondary replica set to allow user queries...this has to be executed on secondary dbs only

After all the failover testings are done, bringing back the failed node to online:
mongod --replSet abc  --dbpath 1 --port 27001 --oplogSize 50 --logpath log.1 --logappend --fork

Read Preference :
rs.slaveOk() for making the secondary replica set to allow user queries...this has to be executed on secondary dbs only
primary  - Default
primary preferred - Try primary if not reachable then read from secondary
secondary - Read from scondary, offload read from primary
secondary preferred - Scondary first then primary
nearest - Nearest member first