Configuring MongoDB with YAML

I just went through the process of configuring the MongoDB server on Windows as a service now that they’ve switched the configuration to YAML.

What a pain in the ass.

All I wanted to do is run it from a directory I typically use on this machine for database files and enable the HTTP interface (including REST).

A couple of pointers that might save you about an hour of hassle.  If you are using Notepad++ tell it to use the YAML configuration for tabs.  I have no idea what it does differently, but that stopped an error where it was complaining about an invalid value at a position right in the middle of a reserved word of the YAML.

Also, if you are specifying that you would like to store your log as a file.  You damn well better specify that destination = file.  I guess specifying the path as a file name wasn’t a big enough hint.

Here is my configuration:

  enabled: true
  RESTInterfaceEnabled: true
 dbPath: “c:\\Data\\mongodb”
 destination: file
 path: “c:\\Data\\mongodb\\log\\mongo.log”

Configuration Reference