MongoDB ReplicaSet Setup Explained
For rstarting up a 3 node cluster with 1 master and 2 slaves follow this https://medium.com/swlh/mongodb-creating-a-3-node-replica-set-cluster-7ca94849b139 First we need a keyfile and appropriate permissions. If the mongod processes were actually running on different machines, then each machine will have a copy of this keyfile. Use OpenSSL to create keyfile - sudo mkdir -p /usr/local/var/mongodb/pki/ openssl rand -base64 741 > /usr/local/var/mongodb/pki/replicaset-keyfile chmod 400 /usr/local/var/mongodb/pki/replicaset-keyfile Create Mongod config files to start mongod processes. Here we will fork the processes to run multiple mongo. ...