No mongod.conf file in /etc/ directory

Dear all,
In “Lab: Logging to a Different Facility” there is no mongod.conf file in /etc/ folder yet I can launch mongod service by just short command “mongod” without any parameter required.

In this course it was explaied that if we dont have mongo.conf file then we have to give seeral parameters in each command.

Mongod.conf file is used by mongod process or by client profram?

Hi @Niket_Agrawal,

Short explanation
Mongod does not need neither a configuration file nor options to start provided that:

  1. the dbPath /data/db exists
  2. the port 27017 is not taken by another process

Details

  • When running the daemon, 1. and 2. are passed behind the scenes, the “default” options.
  • The daemon logs to standard output i.e the terminal.

Read the output to get insight on all previous details.

Because the defaults are compatible, there is no need of flags if mongo is run.

2 Likes

Thanks Sir.

1 Like