Config file and few more doubts

image
can someone help me out ?

and i got some doubts regarding db path and log path
where can i find them in my computer initially while creating the user i gave /data/db for db path and /data/db/mongod.log

Is your config file existing in shared dir?
Please check by running below
ls -lrt /shared/mongod.conf
For dbpath/logpath
use df -k
You can see all mount points
You will see /data
Make sure db dir exists under it

mongo 2 mongo 3

where exactly can does all these files can be found in my computer (i mean all this /dev , /shared and all)

@Shubham_Ranjan

Hi @pavan_30165,

The Linux directory structure is a little different from the Windows directory structure.

Please click on the Summary button ( :arrow_down: ) to expand the details.

Summary

Linux based operating systems are very different from Windows operating systems. We will start with the difference between the directory structure of these two operating systems. In Windows operating systems, all the files are stored in different data drives like C: D: E:.

But in Linux, files are ordered in a tree structure starting with the root directory represented by a forward slash (/). The root directory contains all other directories and files on the system. It is called root because it in a context that this directory is at the very top of the directory tree.

Some top level directories that are part of the root directory by default are /bin, /etc, /tmp, /usr, /home, /root and /var. You can read more about these directories here.

Run this command to get to the root directory :

cd /

Now you can run the ls command to list all the storage.

ls

As you can see in the error message, the files/directory does not exist.

Have you created mongod.conf file and moved it to the /shared directory ?

~ Shubham

well i havent and how to create one and where should i move that , i can see that it is mentioned shared but where can i find that shared folder
@Shubham_Ranjan

In the same location as the provision and vagrantfile on your host/local machine, there’s a shared folder. This folder is automatically synched to the /shared folder on the VM.

Nice collapsible pane @Shubham_Ranjan :slightly_smiling_face:

1 Like

is it the one?
if yes then how can i create mongod.conf
and the shared doesnt contain any files

It’s probably not syncing.

  1. Reload the machine:
    vagrant reload
  2. Share the output of this command:
    ls -lad /{shared,dataset,vagrant}
  3. Share a screenshot of the shared folder on your location machine including the path

21

I dont think it is sync issue
He has not created the confi file

pavan_30165
Just create a zero bytes file on vagrant under /shared
touch test
You should be able to see it in your Windows shared folder
or vice versa
Create a file on Windows shared folder and you should be able to see it on Vagrant Linux box /shared

yea , i ve created a file in shared folder and in shared in vagrant im able to see the file , now i got it . but how can i create mongod.conf

The configuration file is a text file that follows the YAML syntax. In the context of MongoDB, the possible keys and values are documented in https://docs.mongodb.com/manual/reference/configuration-options/

1 Like

Please check this link from steevej-1495 & 007_jb

I’m quite confused on how to create a YAML file

If you are comfortable with Unix/Linux you can create the file on Vagrant box using vi editor(you can use master file /etc/mongod.conf as reference)
If you are not comfortable with Unix you can create it on Windows and call/use that file from Unix box

1 Like

Hi @pavan_30165,

I hope you found the resources shared by @steevej-1495 and @Ramachandra_37567 helpful. Please let me know if you are still having any doubts.

~ Shubham