M103: Lab: Logging to a Different Facility

Hi,
I am getting below error:

user@M103# mongod -f mongod.conf
Unrecognized option: processManagement
try 'mongod --help' for more information

below is my config file.

systemLog:
 path: "/var/log/mongodb/mongod.log"
 destination: file
net:
 bindIp: "localhost"
 port: 27000
security:
 authorization:	"enabled"
processManagement:
 fork: true

The configuration file uses the YAML syntax and the way you posted your file makes it impossible to see the very important and annoying indentation of YAML.

The word processManagement is correct and must start on the first column. The word fork and its value true are also correct but must be indented by 2 spaces.

Read Formatting code and log snippets in posts and repost.

Please find my code

Share the content of the log file.

Please find below logs:

user@M103# cat mongod.log
2022-04-02T12:56:16.241+0000 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten] MongoDB starting : pid=419 port=27000 dbpath=/data/db 64-bit host=OdpcjvQwnGuZj5bZ1m
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten] db version v4.0.5
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten] git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten] allocator: system
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten] modules: none
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten] build environment:
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten]     distarch: x86_64
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2022-04-02T12:56:16.248+0000 I CONTROL  [initandlisten] options: { config: "mongod.conf", net: { bindIp: "localhost", port: 27000 }, processManagement: { fork: true }, security: { authorization: "enabled" }, systemLog: { destination: "file", path: "/var/log/mongodb/mongod.log" } }
2022-04-02T12:56:16.289+0000 I STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2022-04-02T12:56:16.289+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2022-04-02T12:56:16.289+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27000.sock
2022-04-02T12:56:16.289+0000 I CONTROL  [initandlisten] now exiting
2022-04-02T12:56:16.289+0000 I CONTROL  [initandlisten] shutting down with code:100
user@M103#

You got the error

Verify the specification of the lab as I think you are supposed to specified a different data path.

Don’t know that why this /data/db was not there. I just created the same and issue resolved.
Thanks

Because it is not where you supposed to store your data. You did the wrong thing by

You should have

So I went back to the lab to see by myself, in case my memory does not serve me well. The labs starts with:

  1. Update your configuration file such that

It is not crystal clear, but it meant to update your configuration file from the previous lab. And in the previous lab you created the directory /var/mongodb/db/ and stored the data files in it.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.