1

Some background

I had an issue with my replica set the last 24 hours, where the members could not connect to each other, and I got errors such as; could not connect to .... the machine actively refused it; read error; connect error etc.

Things I did to try and resolve it:

  1. I rebooted my PC
  2. I restarted the servers a bunch of times

But nothing seemed to work. I could connect to each member via the shell, and each member status was SECONDARY.

Why I did this

On one of my members a kept getting a message that there was a problem or failure with my shutdown, and that there was some issue with the mongod.lock file (I can't remember the exact message...).

My resolution

Finally, I deleted the mongod.lock file in each member directory, boot up the members, and a connection was established and a vote took place.

My Question

Was this a wise move? What would be the preferred method?

Thank you for your input and help!

2

As per my original question, my solution was as follows:

My resolution

I deleted the mongod.lock file in each member directory, boot up the members, and a connection was established and a vote took place.

Thank you to Dmytro Shevchenko for assisting with clarification via his link, explaining that deleting the mongod.lock files are OK.

-1

please create keyFile and place in each server , put the keyFile in config file, you can create keyFile using below command

openssl rand -base64 741 > mongodb-keyfile
chmod 600 mongodb-keyfile

you can put the keyFile in config file using below option and start the replication

keyFile = /path/to/keyFile

AND One more thing is if your system belongs to any domain, it should be in that vpn itself to communicate, you can try ping those server whether they can send packets or not.

  • keyfiles have nothing to do with the issues described above, and though the issue could have been network related (thought there is no direct evidence), there is no mention of a VPN at all. I don't think your answer has anything to do with this question I am afraid – Adam C Nov 18 '15 at 12:48
  • Adam, Appreciate your prompt responce, before posting this answer i had faced this issue earlier, so i have kept my thoughts, in my office laptop which is belongs to my office domain i can able to see replSet available when i connect to office VPN else it threw error. – Darshan J Nov 19 '15 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.