/M103-Replica-Lab$ mongod -f mongod-repl-1.conf Error parsing YAML config file: yaml-cpp: error at line 2, column 8: illegal map value try 'mongod --help' for more information

Hi Team,

I have created conf file as below
storage:
dbPath: /var/mongodb/db/1
net:
bindIp: localhost,192.168.103.100
port: 27001
security:
authorization: enabled
keyfile: /var/mongodb/pki/m103-keyfile
systemlog:
destination: file
path: /var/mongodb/db/node1/mongod.log
processManagement:
fork: true
replication:
replSetname: m103-replica
when I tried to run the file
mongod -f node1.conf

I am getting below error

/M103-Replica-Lab$ mongod -f mongod-repl-1.conf
Error parsing YAML config file: yaml-cpp: error at line 2, column 8: illegal map value
try ‘mongod --help’ for more information

Please check indentation
Under storage heading
dbpath should be 2 spaces to right
Don’t use tab.Use space bar

1 Like

Hi @Milind_19368,

In addition to @Ramachandra_37567,

Please make sure you are entering the correct name of the various parameters that you have used in the configuration file.

For instance,

keyfile should be keyFile

systemlog should be systemLog

replSetname should be replSetName

Hope it helps!

If you still have any query, then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Are you sure you’re trying to run the correct config file?

You say you’re trying to run this command:
mongod -f node1.conf

But your error references this command:
mongod -f mongod-repl-1.conf

Are you trying to run node1.conf or mongod-repl-1.conf?

1 Like