0
votes

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?

1
How are you starting the mongod instances? Are you setting the --replSet and --bind_ip options? docs.mongodb.com/manual/tutorial/deploy-replica-setBajal
Hello Bajal. yes, I am using the stateful set on kubernetes cluster here, As i provided in the link, i configured the --bind_ip as 0.0.0.0. how could i configure --replSet and --bind_ip options? Is there any alternative ways for that? Would you please suggest me?gayathri

1 Answers

0
votes

kill mongod processes in ubuntu sudo killall -9 mongod or

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