Paul T. Rykiel
Paul T. Rykiel

Reputation: 1227

Why am I getting a parser error on my YAML config in MongoDB --Install

I am trying to install the service for Mongodb. I am typing the following command in the cmd window, as administrator

c:/mongodb/bin/mongod.exe --config "C:\mongodb\mongod.cfg" --install, 

but I am getting the following error:

Error parsing YAML config file: YAML-cpp: error at line 2, column 13 : illegal map value

Here is the config file contents:

systemLog:
    destination: file
    path: c:\data\log\mongod.log
storage:
    dbPath: c:\data\db

Upvotes: 8

Views: 9187

Answers (1)

Jean-Luc Aubert
Jean-Luc Aubert

Reputation: 620

Well, Note that YAML doesn't really satisfy with tabs, then, use space instead before destination and storage. Don't forget to add a space after every ":" even in the lines systemLog and storage Finally, use quotes to enclose your pathes and double backslashes in these pathes.

Try then with :

systemLog:
 destination: file
 path: "c:\\data\\log\\mongod.log"
storage:
 dbPath: "c:\\data\\db"

Upvotes: 14

Related Questions