Lab - Launching Mongod (New User Need Help)

Chapter 1: The Mongod

Lab - Launching Mongod

Here is my steps:
Step 1
image
Step 2
image
Step 3
image
Step 4
image
Step 5
image
Step 6
image
Please help me to understand what I am doing wrong.

I am trying to use the hint, but no success
image

And I have tried to do the same, while I conected to mongo
image

Ectually I don`t understand the lab question. What I am looking for to enter the lab answer?

Hi @Semion_79117,

Couple of things that I would like to mention here :

  1. Please read the instructions mentioned in the lab very carefully. You are missing few parameters such as --bindip and authentication.

    If you need help with these options then please refer our documentation on mongod and see how to use these options.

  2. The user - m103-admin already exists as you can see in the error message.

  3. Your second mongod instance failed to run because another mongod instance was already running on the same port and it was using the same datapath.

I will suggest you to kill all the currently running mongod instances and start it with the correct options as it is mentioned in the lab.

Hope it helps!

Thanks,
Shubham Ranjan
Curriculum Services Engineer

1 Like

Please see my last screens. I have tried to kill, after I got a explanation how to do that, but no success.

kill without “<” and “>”

Are we talkig about the same lecture? I am in lab 1 - lunching mongod. There is no mention about bindip or authentication in lecture transcript file. But I will chek your link later. Thanks

Unfortunately, I have no idea what you’re talking about. Please, if it’s not difficult, point me in the pictures where to look.

I am killing him again and again, but he don`t want to die.
I’d really appreciate it if you could tell me in my pictures exactly where I should to type just the word “kill”. If you will do that by my screens, I will understand where exaxtly in my steps I am making a mistake.

Hi Semion_79117
kill is an os(unix) command to terminate a process
Using the PID(process ID) you kill a process
007_jb suggested you to run kill command without braces < > which means just run command as below

kill 2123
The number is PID here from your ps -ef|grep output
or you can also use
kill -9 2123–>sure kill

You are again running os commands at mongo prompt.It won’t work
Second instance failed to run is what Shubham mentioned.What it means is you may be trying to bringup mongod on same port or dbpath.It will abort or core dumps
It won’t allow you since another instance is already up and running.So you have to kill the running instance first
You can find about bindip in our forums.May be in the lectures it is covered later
That is what i heard from few other students

if I start the whole process over again. For example, two days after my computer rebooted. Do I have to kill 2123 before I start? Or after rebooting the computer this process no longer exists? I’m asking this question because I’ve done all these steps so many times, with my mistakes in the commands I run, and where these coomands need to be entered. So I have no idea or there are dozens of other processes that I have to kill before I start over?

Hi

First thing use kill command with caution
It is a powerful command
If you are unsure after a reboot of process exists or not we should check if it is up and running or not by ps -ef|grep mongo
If your PC rebooted it depends on your vagrant status(graceful shutdown,suspend or aborted status)
Normally on a Unix server the process is up till server is rebooted
2123 is fixed for the process you started earlier.It keeps changing
Say you started a new mongod.It will have a different PID
So you have be clear what you want to kill before you issue the kill command
kill is an os command so you have to run it on vagrant unix box

No.You don’t have to kill bunch of other processes
Just the mongod processes need to be cleaned

1 Like

hi,
in the end you should open 3 shells.
In the first shell you open the vagrant shell and create the directory “db” inside “data”. When you launch mongod, pay close attention when you insert --port --dbpath /data/db/ --bind_ip .
Open a second cmd where you will launch the vagrant shell and from there launch mongo --port (insert the right port). Make sure you connect to admin database (“use admin”), and use “show users” to check if you created the user in the right database. If you did, then exit for just one moment from mongo shell, and go back in launching " mongo --port 27000 --authenticationDatabase “admin” -u “m103-admin” -p" insert the password that you can find in the lab instructions.
Now open a third cmd and again get into vagrant shell, where you can finally lunch the “validate_lab_launch_mongod” and get this damn code! =D

Enjoy

The following is misleading

It is the directory db inside /data not inside data. The leading slash is important.

1 Like

Good tips @michele_86234, but to clarify…

If you initially had authentication enabled (as per the requirement) then you will not be able to run show users. You must have authenticated with the correct credentials and on the correct authentication database in order to run show users, which then makes this step of “checking if the user was created in the right database” an unnecessary step.

Hi 007_jb,
yep you’re right, it is redundant, but i just wanted to be sure that the user was registered on the right db and correctly.

1 Like

Hi steevej-1495,
yes of course the leading slash is important, that’s why I wrote the path correctly at the end of my comment. Thanks anyway