M103-Configuration file option

Hi

Do i have to create a new directory data/log/ and a file mongod.log ???

storage:

dbPath: “/data/db”
systemLog:
path: “/data/log/mongod.log”
destination: “file”
replication:
replSetName: M103
net:
bindIp : “127.0.0.1,192.168.0.100”
ssl:
mode: “requireSSL”
PEMKeyFile: “/etc/ssl/ssl.pem”
CAFile: “/etc/ssl/SSLCA.pem”
security:
keyFile: “/data/keyfile”
processManagement:
fork : true

All directories must exist created and be writtable as per the instructions. The log file does not have to exist. However the config file has to exist.

Could someone help me please with the configuration file

I created the /var/mongodb/db directory

but when executing, mongod -f “config.file”

I get the following error:
Attempted to create a lock file on a read-only directory: /var/mongodb/db, terminating

As I wrote:

And you may use sudo chmod +w /var/mongodb/db/ to make your directory writtable.

Thank you for replying sir Steeve
I tried your command but when I try to run mongod -f “config.file”, I still get the same error message.
The configuration for the directory is as follow:
drwxrwxr-x 3 vagrant vagrant var
Is there another thing I can do to try to run the config.file with another dbpath?
Thank you

Is it var or /var?

The command pwd will tell you. I think the validation script wants it to be /var. However the write permission must be on the full path, that is /var/mongodb/db/

Hi sir
The output of pwd command was: “/var/mongodb/db”
and still I can’t get mongod -f to run.
But thank you sir, for the help

Did you sudo chmod +w /var/mongodb/db/ to make the directory writable?