Lecture: Configuration File

I can open the path: mongod --dbpath /data/db --logpath /data/log/mongod.log

answer: F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open “/data/log/mongod.log”.

Someone can help me

Can you provide the output of ls -l /data/log?

vagrant@m103:~$ ls -l /data/log
ls: cannot access /data/log: No such file or directory

and:

ima@marcos:~$ ls -l /data/log
ls: não foi possível acessar ‘/data/log’: Arquivo ou diretório não encontrad

The directory does not exist so mongod refuse to start. You must create the directory.

But how I create the directory?

You can also listen again and read lecture notes in chapter 1 / lesson 1 of this course : it’s well explained and should really help you.

had the same issue, and used:

vagrant@m103:~$ mkdir /data/log/

This seemed to work.