使用特定配置文件启动 mongo

使用 --config 标志。

$ /bin/mongod --config /etc/mongod.conf
$ /bin/mongos --config /etc/mongos.conf

请注意,-f 是 --config 的较短同义词。