Configuration File

Greetings to all.

I have created a Configuration file stored in CONFIG.conf, in the path where I! run the Vagrant ssh command.
Sample file and error is as shown.Please help.

Capture

Capture

Capture

Thanks in advance.

The file must reside in the shared subdirectory in order to be visible in both Windows and vagrant.

1 Like

Where exactly should I store the file?

Gives an error saying config file cannot be found.When stored inside the shared folder in M103.

Figured out, thanks.

I am facing the same issue. Can you let me know how you resolved it?

Hi @jnvdasa,

Please create your config file in the shared folder and make sure you specify the complete path of the file while launching your daemon as shown below:

mongod --config /shared/config.conf

Kindly let me know if you still face any issues.

Thanks,
Muskan
Curriculum Support Engineer

1 Like

Hi,

i have put my config.conf file inside the shared folder of the vagrant folder but vagrant won’t still find the file. what should i do?

Thanks

Save your config file by the name of mongod.cfg(this the configuration file written from scratch) and saved it in shared directory(shared is a folder name).

Rename your config file to mongod.cfg .

The exact name of the file is not important. As long as you use the same name when starting mongod.

Hi @Melakeselam_Moges_Mengistu_42275,

I would recommend you to cd into the shared directory where you are storing your configuration file and then run the mongod instance using the configuration file from there itself.

Hope it helps. If the issue still persists please feel free to get back to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hello,
I placed my mongod.conf in a shared folder(i.e) ~\University\m103\m103-vagrant-env\shared, and yet i cannot access it from the virtual machine through command prompt, can someone help me here please

It looks like vagrant did not mount the shared directory. Just run df to see if that is the case. You should have an entry for it if it is mounted. If it is not mounted you could try to mount it with sudo mount /shared. I am not too sure if it is called /shared but you can look in /etc/fstab to see what it is.

thanks for your prompt response, i run df and /shared folder was among the mounted folders and yet when i tried to read the config file by running mongod -f /data/mongod.conf i got en error message that says " No such file or directory
try ‘mongod --help’ for more information ". Please what can i do

Hi @Bobobee,

Where is this folder called data located ?

Is it inside the /shared directory or it is in the root directory ?

Thanks,
Shubham Ranjan
Curriculum Support Engineer

it’s on the virtual machine, anyway thanks for your response, i’ve been able to solve the riddle by running mongod -f /shared/mongod.conf, since the config file was placed inside shared folder.

thank you very much

Hi @Bobobee,

I’m glad your issue got resolved. If you have any other query then please feel free to create another thread.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

1 Like