Friday, 11 June 2021

Load mongodb settings from a configuration file

MongoDB configurations can be defined in a yaml file and supplied to mongod command via --config option.

 

mongoConf.yml

net:
   bindIp: 127.0.0.1
   port: 8888
storage:
   dbPath: /Users/Shared/data/db

 

Execute below command to start mongodb server with the configuration specified in mongoConf file.

mongod --config {PATH TO mongoCong.yml FILE}

 

Refer below link to know more details about different configuration options.

https://docs.mongodb.com/manual/reference/configuration-options/

 

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment