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:

image

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:

image

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

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:

replication:
  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:

storage:
  dbPath: "/data/db"

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

storage:
  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.