I would suggest that you start from scratch. And also suggest that you double check all your config files to make sure you don’t have overlapping ports or directories, basically ensure that all the options and lines in all configuration files are correct.
To start with a clean slate, suggest the following steps:
- Destroy, re-provision and login to the VM
vagrant destroy
vagrant up
vagrant ssh
NB: when you run destroy, you need to confirm with a y
- Create all relevant parent and sub directories, give vagrant ownership to parent dir, and create keyfile. Copy, paste and execute the entire block of code in one go:
sudo mkdir -p /var/mongodb/pki/
sudo chown -R vagrant:vagrant /var/mongodb/
mkdir -p /var/mongodb/db/{1,2,3,4,5,6}
mkdir -p /var/mongodb/db/csrs{1,2,3}
openssl rand -base64 741 > /var/mongodb/pki/m103-keyfile
chmod 400 /var/mongodb/pki/m103-keyfile
Now you can start to build your replica sets. As a reminder:
- Build nodes 1,2,3 as data bearing Replica Set 1
- Build nodes 4,5,6 as data bearing Replica Set 2
- Build nodes 1,2,3 as Cluster Server replica set
- Run mongos, check
sh.status()
to make sure the config is linked, add shards RS1 and RS2
Remember to double check all your config files.
Double check each step to ensure that your replica sets have been built before moving on to the next step. Use rs.isMaster()
and rs.status()
as you go along.