Moped::Errors::ConnectionFailure Could not connect to any secondary or primary nodes for replica set
Asked Answered
I

2

10

I had to forcefully shutdown my Ubuntu system after it got hanged. Now I get this error while trying to run my Rails app.

Moped::Errors::ConnectionFailure (Could not connect to any secondary or primary nodes for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>):

Im using Rails 3.2.11 with Mongoid 3.1.4.

What could be wrong?

Inset answered 12/8, 2013 at 5:31 Comment(0)
I
23

I was able to get it working by removing the mongod.lock file and restarting mongodb service

sudo rm /var/lib/mongodb/mongod.lock
sudo service mongodb start
Inset answered 12/8, 2013 at 9:5 Comment(0)
S
0

Uninstall mongodb using

sudo apt-get autoremove mongodb-*

then install with

apt-get install mongodb-server

run mongo
it will solve the problem

Saltandpepper answered 9/9, 2019 at 11:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.