mangodb configration

You can control mongod and mongos instances at runtime using a configuration file. The configuration file contains settings that are functionally equivalent to the mongod and mongos command-line arguments but are easier to manage, especially on large-scale deployments. Configuration files allow commenting to describe the reasoning behind a server’s settings.

If you installed from a package and have started MongoDB using your system’s control script, you are already using a configuration file.

Specifying the Configuration File when Starting MongoDB

To start mongod or mongos using a config file, specify the config file with the --config option.

For example, the following specifies a config file for a mongod:

mongod --config /etc/mongodb.conf

The following specifies a config file for a mongos using the -f alias:

mongos -f /etc/mongodb.conf

Config File Format

The configuration file is in YAML format. The following is an example of several settings in a configuration file:

systemLog:
   destination: file
   path: "/var/log/mongodb/mongodb.log"
   logAppend: truestorage:
   journal:
      enabled: trueprocessManagement:
   fork: truenet:
   bindIp: 127.0.0.1
   port: 27017...

你可能感兴趣的:(mangodb configration)