官术网_书友最值得收藏!

How it works...

MongoDB allows passing command line parameters to mongod using a YAML file. In step 1, we are creating a config file called mongod.conf. We add all the previously used command line parameters from this chapter, into this config file in YAML format. A quick look at the file's content should make it clear that the parameters are divided into sections and relevant subsections. Next, in step 2, we start the mongod instance, but this time with just one parameter --config followed by the path of our config file.

As we saw in earlier recipes, although passing configuration parameters seems normal, it is highly advisable that one should use configuration files instead. Having all parameters in a single configuration file not only makes it easier in terms of viewing the parameters but also helps us programmatically (YAML FTW!) inspect and manage the values of these variables. This simplifies operations and reduces the chance of errors.

主站蜘蛛池模板: 双桥区| 铁力市| 南汇区| 远安县| 西安市| 长沙县| 昭苏县| 白河县| 临清市| 大石桥市| 宣恩县| 缙云县| 铜陵市| 玉田县| 长武县| 渑池县| 嫩江县| 平和县| 莫力| 武冈市| 西丰县| 南丹县| 石狮市| 竹溪县| 阿坝| 莱阳市| 建始县| 景洪市| 郯城县| 库尔勒市| 灌云县| 五华县| 夏河县| 桐庐县| 河源市| 平舆县| 龙山县| 界首市| 德保县| 蕉岭县| 威宁|