Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The MongoDB docs say my config file should be YAML. It's not. Why?

Tags:

mongodb

I'm using MongoDB 2.6 wherein the docs clearly state the config file is YAML.

When I go to open my config, /etc/mongod.conf, it looks like this one in the github repo (which is also MongoDB 2.6)

What gives, and how do I configure my server when the docs don't match the deployed default config, at all?

like image 422
user2085368 Avatar asked Aug 27 '14 02:08

user2085368


People also ask

Does MongoDB support Yaml?

File FormatMongoDB configuration files use the YAML format [1].

What is configuration file in MongoDB?

The MongoDB configuration file provides MongoDB database admins with numerous options and settings for controlling the operation of the database system. A MongoDB configuration file can be used to configure mongod and mongos instances at startup.


1 Answers

Well, the new format is YAML, but 2.6 still supports the old format:

The 2.4 configuration file format remains for backward compatibility.

You can find documentation on the old format here and as you have discovered, there are far more examples out there of the old format then on the new YAML based one. I'm not aware of anything that you can do in the new format that you can't do in the old. And I'm aware of a number of people struggling to configure the new YAML format due to few examples being available and the touchiness of the new format to spacing/tabs/etc.

Personally I'm still using the old format and will continue to do so until I see a compelling reason to switch.

Here's the docs on the old format:

http://docs.mongodb.org/v2.4/reference/configuration-options/

like image 185
John Petrone Avatar answered Oct 21 '22 01:10

John Petrone