Error couldn't connect to server

I am using Mac and currently not able to do lab 1.

In my first shell I’m connected to mongod --port 27000

then I open my second shell to connect to mongo and I get the error message:

Error: couldn’t connect to server connection attempt failed: SocketException: Error connecting to :: caused by :: Connection refused :
exception: connect failed

Mongod did not start. shutting down with code:100 means mongod refuses to start. A few lines above the shutting down message you see Data directory /data/db not found. This means that mongod cannot find the directory /data/db. You have to create it.


Thank you steevej-1495
I have actually managed now to connect to the port 27000. I am using a Mac, so here are the steps I took to do Lab 1:

  1. vagrant up --provision (in the right directory m103-vagrant-env folder)
  2. vagrant status - confirmation step
  3. vagrant ssh
  4. new window on my terminal: mongod --port 27000

  1. new window on my terminal: mongo --port 27000
    the user had previously been created

  1. drop user and add it back because it seems incorrect

  1. go back to vagrant@m103:~$ validate_lab_launch_mongod and I get error message:

Problem solved, everything has to be within vagrant now I see