The mongod.conf file for a mongos instance has one major difference from the shard configuration files: there is no storage option. The purpose of the mongos instance is not to handle data, but rather to serve as an intermediary between a MongoDB application programming language driver, the config server, and the sharded cluster. The following is the mongos.conf file that's used to start the mongos instance. It gives us access to our model's sharded cluster:
systemLog:
destination: file
path: "/var/log/mongodb/mongodb.log"
logAppend: true
net:
bindIp: 0.0.0.0
port: 27020
sharding:
configDB: repl_config/config1.biglittle.local:27019
To start the mongos instance, we use the following command:
mongos -f /etc/mongos.conf
The following screenshot shows the results:
When opening a shell, we can simply indicate the port that the mongos instance is listening on. Here is the result:
Now, we can restore the sample data before proceeding...