Chapter 1: The Mongod - Lab: Configuration File

I’m doing the Lab in this section. I was able to run my configuration file as shown below:


However, I’m having some trouble with the second part of the assignment that is about creating the user as directed by the instruction. When I run the following command, I get the error below:


What seems to be the problem and how can it be fixed?

As it was stated before, there is at least one error in the configuration file. This line is not correct because it initializes a replica set:

  replSetName: M103

and the lab is about a standalone server.

It is also suggested not to use the dbPath, so this line shouldn’t be there neither:

  dbPath: "/data/db"

It works now.
But where in the instructions does it mention not to use:

  dbPath: "/data/db"

And why shouldn’t we use it?

It does not say not to use but it does not say to use it. In principle you should not be using anything that has not been introduced. The requirements were:

Write the configuration file. There should be an empty configuration file in your IDE File Editor, where you can specify options in YAML.

As a reminder, here are the requirements of your mongod instance:

  • run on port 27000
  • authentication is enabled
1 Like

Ok thanks.