I am getting this error on the NFSv3 filesystem as well
sudo docker run -it -v /mnt/mongo:/data/db --name mongodb e6fa3383f923
2020-11-12T09:09:15.814+0000 I STORAGE [initandlisten] exception in initAndListen: Location28596: Unable to determine status of lock file in the data directory /data/db: boost::filesystem::status: Permission denied: “/data/db/mongod.lock”, terminating
[root@init78a-36 ~]# mount | grep /mnt/mongo
10.20.20.3:/mongo on /mnt/mongo type nfs (rw,noatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.20.20.3,mountvers=3,mountport=2049,mountproto=udp,local_lock=all,addr=10.20.20.3)
Changed the filesystem to be writeable by mongod but still, I get the below error
{“t”:{"$date":“2020-11-12T17:35:40.193+00:00”},“s”:“E”, “c”:“STORAGE”, “id”:20557, “ctx”:“initandlisten”,“msg”:“DBException in initAndListen, terminating”,“attr”:{“error”:“Location28596: Unable to determine status of lock file in the data directory /data/db: boost::filesystem::status: Permission denied: “/data/db/mongod.lock””}}
Avoid using NFS drives for your dbPath. Using NFS drives can result in degraded and unstable performance. See: Remote Filesystems for more information.
@chris would this be applicable for docker containers as well?
My deployment is MongoDB on - Docker - NFS storage.
[root@init78a-36 ~]# mount | grep /mnt/mong
10.20.20.3:/mong on /mnt/mong type nfs (rw,noatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.20.20.3,mountvers=3,mountport=2049,mountproto=udp,local_lock=all,addr=10.20.20.3)
sudo docker run -it -v /mnt/mong/:/data/db --name mongonew1 ba0c2ff8d362
{“t”:{"$date":“2020-11-13T12:05:24.738+00:00”},“s”:“E”, “c”:“STORAGE”, “id”:20557, “ctx”:“initandlisten”,“msg”:“DBException in initAndListen, terminating”,“attr”:{“error”:“Location28596: Unable to determine status of lock file in the data directory /data/db: boost::filesystem::status: Permission denied: “/data/db/mongod.lock””}}