BSG
BSG

Reputation: 723

Unable to lock the lock file: /data/db/mongod.lock. Another mongod instance is already running on the /data/db directory, terminating

I trying to run mongodb statefulset with three replicas in kubernetes using nfs persistence storage. Out of three pods mongo-0 pod is in running and another two pods are showing CrashLoopBackOff. I saw the logs of those two pods and getting the error like

2018-11-27T21:38:18.581+0000 I STORAGE [initandlisten] exception in initAndListen: DBPathInUse: Unable to lock the lock file: /data/db/mongod.lock (Unknown error). Another mongod instance is already running on the /data/db directory, terminating

Here the link for my pv, pvc and mongodb statefulset files.

Could anybody suggest me on this issue?

Upvotes: 1

Views: 3838

Answers (1)

vimal
vimal

Reputation: 1

kill mongod processes in ubuntu sudo killall -9 mongod or

ps -aux|grep mongo kill -9 [PID] PID of mongod

Upvotes: 0

Related Questions