Arthur Bosua - mongod launch config file not found

On trying to load mongod with a configuration script in YAML saved in /m103-vagrant-env, the following error is generated

vagrant@m103:~$ mongod --config ‘mongod.txt’
Error reading config file: No such file or directory
try ‘mongod --help’ for more information

vagrant@m103:~$ mongod -f ‘mongod.txt’
Error reading config file: No such file or directory
try ‘mongod --help’ for more information

Where must the config file be saved?
I am working on Win10 platform

@Arthur_48756 Double check the file extension (i.e. .conf vs. txt) AFAIk the file can be anywhere, also double check the folder you are launching mongod from has that file in the same folder.

HTH,
Mike

I have the config file mongod.txt in :
c:\ (root)
c:\data,
C:\mongodb\university\m103\m103-vagrant-env,
C:\Program Files\MongoDB\Server\4.0\bin (the mongoDb launch dir.)
C:\Program Files\MongoDB\Server\4.0\data

I tried with file extentions .yml, .txt, .confg, .cfg
I used the script filename with and without text delineators (" or ')

The task require a Vagrant ssh from C:\mongodb\university\m103\m103-vagrant-env
once in the shell (vagrant@m103:~$), I try to execute the command: mongod --config ‘mongod.txt’
Is it possible that it is looking on the VM (ubuntu)?

the config file content:
storage:
dbPath: “/data/db/”
net:
port: 27000
bindIp: “localhost,192.168.103.100”
security:
authorization:
enabled: true

It must not be executed from within the shell (vagrant ssh) but from the DOS-shell

  1. The file must reside on the vagrant machine.
  2. If it is under C:\mongodb\university\m103\m103-vagrant-env\shared\ it is visible on Windows and on the vagrant VM.
  3. The mongod --config ConfigFile command must be run inside the vagrant vm. That is at the prompt you get when doing vagrant ssh.
1 Like

@Arthur_48756 The mongod instance should be launched from within the Vagrant VM as that’s where it was provisioned. The mongod.conf can be created within any folder in the VM or in a folder that was mounted to the VM. Given the command you are providing, it would look in the folder you are executing mongod from, is that file in that folder on the VM? That is, when you are in the Vagrant VM and do an “ls” does the config file appear there?

HTH,
Mike

in Dos
C:\mongodb\university\m103\m103-vagrant-env\shared\mongodb.conf
in VM
mongod -f ‘/shared/mongod.conf’
and it works!

Hi Arthur – this works … so it should be a network path and not a direct path … I am getting a different error – which means that it reading the file … Thanks!!!