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

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.

主站蜘蛛池模板: 泗洪县| 南部县| 荥阳市| 菏泽市| 达尔| 呼玛县| 浦东新区| 岳阳县| 准格尔旗| 海兴县| 苍梧县| 金湖县| 甘德县| 射阳县| 石门县| 维西| 中西区| 多伦县| 如东县| 太康县| 徐水县| 宾阳县| 迭部县| 平定县| 日照市| 长汀县| 吕梁市| 黔江区| 嵊泗县| 宁河县| 宽城| 陇南市| 深水埗区| 名山县| 鹤峰县| 崇仁县| 岳西县| 溧水县| 蒙山县| 昆山市| 枣阳市|