Once you have installed MongoDB, you need to be able to start and stop the database engine. You start it by executing the mongod
executable (mongod.exe
on Windows) at <mongo_install_location>/bin
. This executable starts MongoDB and begins listening for database requests on the configured port.
You can control the mongod
executable by setting several different parameters. For example, you can configure the IP address and port that MongoDB listens on, as well as logging and authentication. Table 12.1 provides a list of some of the most commonly used parameters.
Here’s an example of starting MongoDB with port
and dbpath
parameters:
mongod –port 28008 –dbpath <mongo_data_location>/data/db