If you followed the procedure outlined in the previous section, a configuration file /etc/mongod.conf will have been auto-generated by the installation script. By default, data files will be placed in /var/lib/mongodb and log files in /var/log/mongodb/mongod.log:
You are now able to perform these operations:
Operation | Command |
Start | stop | restart the server | sudo service mongod start|stop|restart |
Get the server status | sudo service mongod status |
Access MongoDB via the shell (covered later) | mongo --host 127.0.0.1:27017 |