Chapter 2 Lab 2 :- Use Configuration File

Hello Team,

I am facing below error while completing the Lab 2 of Chapter 2 in M103.

My Conf file :-

# fill out this configuration file, mongod.conf!
# and then use it to run mongod with:
# mongod -f mongod.conf
storage:
  dbPath: "/data/db"
systemLog:
  path: "/data/log/mongod.log"
  destination: "file"
replication:
  replSetName: M103
net:
   port: 27000
security:
    authorization: enabled
setParameter:
   enableLocalhostAuthBypass: false

Please let me know what needs to be done here.

Thanks,
Debmalya

Hi @DEBMALYA_MAHAPATRA,

Welcome to the MongoDB Community Forums,

You have to enable the authorization by adding the following in the config file.
security:
authorization: enabled

and there is no need of
setParameter:
enableLocalhostAuthBypass: false

Moreover, we can see you have successfully completed this lab.
Let us know if you still have any questions or doubts.

Regards,
Kushagra

1 Like

Hello,

Yes. After I tried that and it worked fine for me.

Thanks,
Debmalya