sysadmin@server:~$ chown -R mongodb:mongodb /data/var/lib/mongodb
chown: cannot read directory '/data/var/lib/mongodb': Permission denied
sysadmin@server:~$ sudo chown -R mongodb:mongodb /data/var/lib/mongodb
[sudo] password for sysadmin:
sysadmin@server:~$ sudo systerctl start mongod
sudo: systerctl: command not found
sysadmin@server:~$ sudo systemctl start mongod
sysadmin@server:~$ sudo systemctl status mongod
× mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-08-11 07:44:29 UTC; 10s ago
Docs: https://docs.mongodb.org/manual
Process: 85895 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)
Main PID: 85895 (code=exited, status=100)
CPU: 31ms
Aug 11 07:44:29 server systemd[1]: Started MongoDB Database Server.
Aug 11 07:44:29 server mongod[85895]: {"t":{"$date":"2023-08-11T07:44:29.870Z"},"s":"I", "c":"CONTROL", "id":7484500, "ctx":"-","msg":"Environment variable MONGODB_CONFIG_OVERRIDE_NOFORK == 1, overriding \"processManagement.fo>
Aug 11 07:44:29 server systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a
Aug 11 07:44:29 server systemd[1]: mongod.service: Failed with result 'exit-code'.
lines 1-12/12 (END)
sysadmin@server:~$ sudo tail -f /var/log/mongodb/mongod.log
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"ASIO", "id":22582, "ctx":"MigrationUtil-TaskExecutor","msg":"Killing all outstanding egress activity."}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"COMMAND", "id":4784923, "ctx":"initandlisten","msg":"Shutting down the ServiceEntryPoint"}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"CONTROL", "id":4784925, "ctx":"initandlisten","msg":"Shutting down free monitoring"}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"CONTROL", "id":4784927, "ctx":"initandlisten","msg":"Shutting down the HealthLog"}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"CONTROL", "id":4784928, "ctx":"initandlisten","msg":"Shutting down the TTL monitor"}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"CONTROL", "id":6278511, "ctx":"initandlisten","msg":"Shutting down the Change Stream Expired Pre-images Remover"}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"CONTROL", "id":4784929, "ctx":"initandlisten","msg":"Acquiring the global lock for shutdown"}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"-", "id":4784931, "ctx":"initandlisten","msg":"Dropping the scope cache for shutdown"}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"CONTROL", "id":20565, "ctx":"initandlisten","msg":"Now exiting"}
{"t":{"$date":"2023-08-11T07:44:29.880+00:00"},"s":"I", "c":"CONTROL", "id":23138, "ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":100}}
Frustrating…
But thanks for your support 