Configuration File

Am trying to run mongod from config file, but I keep getting NO SUCH FILE OR DIRECTORY.

Please, I need help here.

image

My folder, am calling the file inside SHARED folder
image
image
image

please, I need to know why this is not working.
thanks

This was what i had before removing one, both was created while i was trying to know if the naming was part of my challenge.

What do you get when run pwd command?

Unrelated issue, but you have a problem here:
image

1 Like

I just noticed, the file extension is different from the one you’re calling:

1 Like

Hi @Onyeka_16206,

Please fix your config file and the file extension name being passed in your command line as has been keenly highlighted by @007_jb.

Let me know if it still doesn’t work.

Thanks,
Muskan

Still getting NO SUCH FILE OR DIRECTORY

image

Hi @Onyeka_16206,

This time you missed adding “/” to the directory path.

It should be /shared/mongod.conf .

Hope this helps!

Thanks,
Muskan

Hello @Muskan_47318 , I Just added the “/” now but still same thing

image

Hi @Onyeka_16206,

Okay, I see.

Can you please share the output of pwd command?
This will tell your present working directory, i.e. where you are trying to access /shared/mongod.conf from.

Thanks,
Muskan

This is the output of my PWD command

image

@Muskan_47318 this is the PWD output

image

Hi @Onyeka_16206,

Can you check the output of commands ls -lrt and ls -lrt /shared ?

If you are unable to see your config file in the specified location, you may have to create one inside the /shared using Vim editor.

Please check this and let me know what works.

Thanks,
Muskan

@Muskan_47318 this is the outcome.

Hi @Onyeka_16206,

If you see, the correct “mongod.conf” exists in your current directory which is /home/vagrant.

Whereas, the path that we are mentioning is /home/vagrant/shared that contains “mongod.conf.txt”,

Please edit this file and rename it to be only “mongod.conf”. This should work.

Thanks,
Muskan

Hello @Muskan_47318 i just did all the correction as directed but the issue is still there. NO SUCH FILE OR DIRECTORY

image

Hi @Onyeka_16206,

You are passing the directory name in your config file parameter, it should be the name and path of your file.

Please run your mongod command as below:

mongod --config /shared/mongod.conf

Thanks,
Muskan

@Muskan_47318 , we are good now with the directory and file, thanks so much but i have a error… about bindip or bend_ip , i tried using the two but the same message came. UNRECOGNIZED OTION: NET.BIND_IP

image

Hi @Onyeka_16206,

I would strongly recommend you to go through the lecture notes and lab instructions very carefully.

The correct parameter is “bindIp” as mentioned in the lecture notes, shown in the screenshot below:

Thanks,
Muskan

@Muskan_47318, thanks so much but i actually took that from my lecture note. i have worked over the bindIp issues. this is the issue i have now.

below is my config file.

image

thanks
Onyeka