Configuration file is correct and able to launch mongod as per instruction but still getting error on Run Test

Configuration File:-
storage:
dbPath: “/var/mongodb/db”
systemLog:
destination: “file”
path: “/var/mongodb/logs/mongod.log”
net:
bindIp: localhost
port: 27000
security:
authorization: enabled
processManagement:
fork: true
bash-4.4# mongod -f mongod.conf
about to fork child process, waiting until server is ready for connections.
forked process: 346
child process started successfully, parent exiting

Test Result –
2 total, 0 passed, 0 skipped:
[FAIL] “Mongod was started with the new logpath”

Did you launch mongod with the logpath /var/mongodb/logs/mongod.log?

[FAIL] “Mongod process was forked”

Did you modify your mongod configuration to fork the process?

Can anybody guide what’s wrong? I have given the logpath as mentioned in the problem statement.

Hi @Parnika_Bale ,
Would you check and maybe include this information?

  • What command do you use to initialize the daemon?
  • What is the output?

Does that help you to solve? Also,

  • Are you sure this directory exists?
    /var/mongodb/logs/mongod.log and is not /var/mongodb/log/mongod.log ?

If none of that solves, please, add a screenshot of the configuration file :slight_smile:

Hello ! Below are the information you have asked for. Kindly highlight wherever required.

What command do you use to initialize the daemon?
I used below command and
bash-4.4# mongod -f mongod.conf

What is the output?
Below is the output , I was able to get the command prompt back.
So I guess the fork option that I provided in the configuration file was accepted.

O/P :-
about to fork child process, waiting until server is ready for connections.
forked process: 346
child process started successfully, parent exiting

Are you sure this directory exists?
/var/mongodb/logs/mongod.log and is not /var/mongodb/log/mongod.log ?
Yes, /var/mongodb/logs/mongod.log is the correct directory

@Parnika_Bale

The next step, step 2 in the guide, is to create the user.

Did you create the user?

1 Like

Wow Thanks!! :slight_smile:

I missed that part and was repeatedly checking my config file . Passed now :slight_smile:

2 total, 2 passed, 0 skipped:
[PASS] “Mongod was started with the new logpath”
[PASS] “Mongod process was forked”

1 Like