Error While Deploy Mongodb IN Custom dbpath

Hi Team,

While deploying DB in Custom dbpath/logpath getting below permission denied error.
I followed the below document to install selinux policy but still same error.

May 20 13:33:40 mongodb4 mongod[1589]: {"t":{"$date":"2024-05-20T13:33:40.004Z"},"s":"F",  "c":"CONTROL",  "id":20574,   "ctx":"main","msg":"Error during global initialization","attr":{"error":{"code":38,"codeName":"FileNotOpen","errmsg":"Failed probe for \"/mongodb/data/logs/configsvr.log\": Permission denied"}}}
May 20 13:33:40 mongodb4 systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE

Could someone help me on this.

Thanks,
Debasis

This error suggests that the user that you are trying to run the mongod process with doesn’t have access to create this file “/mongodb/data/logs/configsvr.log”. You will need to change the permissions on that file so the process can create/update that file.

@tapiocaPENGUIN thanks for response. We had already given permission to mongod user but still it fails.

[root@mongodb4 logs]# ll
total 0
-rw-r--r--. 1 mongod mongod 0 May 20 02:35 configsvr.log
[root@mongodb4 logs]# pwd
/mongodb/data/logs
[root@mongodb4 logs]#

Thanks,
Debasis