Doubt on Logging to a Different Facility

Hi everyone, I just starting the lab, I’d made all the changes in the configuration file, and changing and reviewing that the systemlog path were correctly.
Once the configuration file are ok, I’ll execute the validation script, but the response of the script are this:

You need to send your log files to /var/mongodb/db/mongod.log.

I review several times the systemLog configuration on the configuration file, but it’s still happend.
What would it be? Thanks so much. Paz López

I could resolve the doubt finally.
Thanks so much :grinning:, Paz López

1 Like

HA! Another one for the Rubber Ducky debug! Good going Paz!

1 Like

Hi Mari Paz,
Can you tell me how you fixed the problem? Because I have the same one.
Gracias ^^

Hi Manuel, There are two thing for review on the configuration file.
systemLog:
destination: file
path: /var/mongodb/db/mongod.log
logAppend: true
Of course, the folders must exist and must having reading and writing permissions.
The second option that needs changing on the configuration file is processManagement:
fork: true
And the last one is using:
operationProfiling:
slowOpThresholdMs: 50
To put read and write permissions on the /var/mongodb/db/ folder, with the user root (in linux is the user that have all the privileges) you need to write this: sudo chmod 755 /var/mongodb/db/
Othe thing you could make, is executing this command, and as the before command must be executed as root.
sudo chown vagrant:vagrant -R /var/mongodb/db/
If it still not working, please warn me.
Best regards, paz López

2 Likes

Firstly, thanks for your fast answer!
I had my config file exactly in that way. When I try to start mongod with the --config mongod.conf file, now I have a problem like this:

about to fork child process, waiting until server is ready for connections.
forked process: 4425
ERROR: child process failed, exited with error number 100
To see additional information in this output, start without the “–fork” option.

Now, my config file is this:
storage:
dbPath: /var/mongodb/db
net:
bindIp: “127.0.0.1,192.168.103.100”
port: 27000
security:
authorization: enabled
systemLog:
destination: file
path: /var/mongodb/db/mongod.log
logAppend: true
operationProfiling:
mode: “slowOp”
slowOpThresholdMs: 50
processManagement:
fork: true
(with the correct indentation)
If I delete the processManagement, it runs correctly, so I suppose the problem is there.

Hi Manuel_06049,

Please check the log file: “/var/mongodb/db/mongod.log” and it might help you to identify the issue.
Let me know.

  • Make sure the directories has been created (db directory)
  • Make sure it has the right permissions.
  • Make sure no mongod is running on 27000 port

Kanika

2 Likes

Hi kanikasingla,
I found the solution. The problem was in the third point you mentioned. I had mongod running on port 27000. I had to exit vagrant, and when I started again, with the new config file, I got succesfully the “validate_lab_different_logpath”.
Thanks you so much to you and for Mari Paz too! ^^

2 Likes