Replicaset configuration note. 1. Create keyfile using openssl rand -base64 756 > chmod 400 chown 999:999 2. add replication: true in mongo section of the configs.json 3. add db_server_address, secondary_server_address configs in configs.json 4. npm run erxes deploy-dbs. It will start mongodb with keyfile authentication 5. login to mongodb. run rs.add('mongo-secondary') 6. check for rs.status(). secondary node status must change from STARTUP2 to SECONDARY 5. check for firewall config in db server 6. when primary becomes secondary conf = rs.config() conf.members = [{ _id: 0, host: "mongo:27017" }] rs.reconfig(conf, { force: true })