In mac where to paste Configuration File?

Dear all,
I have tried to run mongod using the flags as explained in the 1st chapter of launching mongod, but the task is to run mongod using --config <config_filepath>, now though I am able to create the .conf file, but I am not sure where to paste that file, so it will be accessible to me in Vagrant environment??

I mean if I run mongod --config then what should be the virtual path and where it would resolve to in my host machine.

Thanks
Sunny

You must be having a shared path which maps to vagrant directory
I am not sure of mac but in Windows it will be like

==> mongod-m103: Mounting shared folders…
mongod-m103: /shared => C:/Users/ramrt/M003/m103-vagrant-env/shared
Left side is from vagrant box(Unix) Right side is from Windows
So whatever file you create on Windows will be visible on Vagrant box under /shared
You have to identify your shared dirs.May be from vagrant bootup message you can get clue

I am really not sure how to go about it. During the course it was told that “shared” folder inside “m103-vagrant-env” folder is created so we can share the files between host machine and vagrant environment, but any file or folder I paste inside shared folder does not show up when I run “ls” command in vagrant terminal.

pwd in vagrant shows /home/vagrant . I created one folder “first_mongod”, but I am unable to see that folder in my host machine, probably becuase its in virtual environment.

Thanks
Sunny

I think you are checking in wrong directory
Your shared folder inside m103-vagrant-env is mapped to /shared on
vagrant box
create a file on your shared dir
cd /shared on Unix box
ls -lrt
You should be able to see the file

C:\Users\ramrt\M003\m103-vagrant-env\shared>echo “today is satday” >test

C:\Users\ramrt\M003\m103-vagrant-env\shared>dir
07/27/2019 06:36 PM 20 test
3 File(s) 69,455,354 bytes
2 Dir(s) 159,467,765,760 bytes free

C:\Users\ramrt\M003\m103-vagrant-env\shared>type test
“today is satday”

vagrant@m103:~$ cd /shared

vagrant@m103:/shared$ ls -lrt
total 67833
-rwxrwxrwx 1 vagrant vagrant 46628133 Jan 26 12:42 products.part2.json
-rwxrwxrwx 1 vagrant vagrant 22827201 Feb 13 13:55 people.json
-rwxrwxrwx 1 vagrant vagrant 20 Jul 27 13:06 test
vagrant@m103:/shared$ cat test
“today is satday”
vagrant@m103:/shared$

Hope it is clear now

Sir, I understand what you are saying but this did not work for me at all. So not sure what could be the issue.

Thanks

Can you please paste screen shots
Are you able to see /shared in vagrant unix box?.You have to create it on shared path(/shared)
I think you created your first_mongod dir under /home/vagrant
I just created a dir on vagrant box and i can see on my host machine
Yesterday did other way(created on host machine and was able to see on Unix box)

vagrant@m103:/shared$ mmkdir myfolder
vagrant@m103:/shared$ pwd
/shared
vagrant@m103:/shared$ ls -lrt
total 67833
-rwxrwxrwx 1 vagrant vagrant 46628133 Jan 26 12:42 products.part2.json
-rwxrwxrwx 1 vagrant vagrant 22827201 Feb 13 13:55 people.json
-rwxrwxrwx 1 vagrant vagrant 20 Jul 27 13:06 test
drwxrwxrwx 1 vagrant vagrant 0 Jul 28 01:42 myfolder
vagrant@m103:/shared$

Directory of C:\Users\ramrt\M003\m103-vagrant-env\shared

07/28/2019 07:12 AM .
07/28/2019 07:12 AM …
07/28/2019 07:12 AM myfolder

1 Like