The message waiting for connections on port 27017 indicates that you are able to do so.
but im not getting mongod user prompt.?
Are you using vagrant?
You might not have used --fork option
Please open another session and connect using mongo
If you use --fork mongod runs in background and your prompt returns and you can continue in same session
As @steevej-1495 mentioned, the mongod instance is waiting for connection on the port 27017. You can run mongo command in other shell to connect to this instance.
Because, by default the mongod does not run as a daemon and hence it runs in the foreground. You can use the fork option to run it in the background.
As @Ramachandra_37567 suggested, you can include the –fork command along with the logpath to run the mongod instance in the background.
For additional information on this, you can refer our documentation.
Hope it helps!
Please feel free to get back to us, if you have any issue.
Curriculum Support Engineer
I am also facing the same issue, after entering the mongod command on first command prompt…
As per your suggestion, I opened the another session of command prompt and tried to start the mongod, but still it didn’t happen and facing the below issue.
Hi Just open another session of vagrant and enter mongo you will get the mongoDB prompt.
And what happens if I my vagrant is already running with mongod and when I open a new shell, and type
it gives back the following:
‘mongo’ is not recognized as an internal or external command,
operable program or batch file.
You have to run mongo on the terminal after you go on the vagrant with vagrant ssh.
Looking at other thread, I believe your issue has been resolved.
Please let me know if you are still having any doubts.
Yes. This was the first part of the issue. To solve this, I added the mongo folder to the environment variables. That way it got recognized.
Then, I learned that the mongo shell should be run on the same VM as the server.