Reputation: 10039
I had to force a restart of my linux computer and upon turning back on, nothing related to my Mongodb installation is functioning properly.
My rails app, using Mongoid, is giving this error:
Could not connect to any secondary or primary nodes for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>
on attempting to load a page and a similar error in the rails console.
Everything was running smoothly before and I am not sure how to right this ship.
Upvotes: 1
Views: 976
Reputation: 2781
i don't know it is right or wrong way but it always work for me
rm /data/db/mongod.lock
mongod --dbpath /data/db --repair
mongod --dbpath /data/db
Upvotes: 0
Reputation: 11904
I generally get this error when the mongo daemon is not running. Try running something like this:
sudo mongod --fork --logpath /var/log/mongodb.log --logappend
The method used to automatically start on system boot will vary depending on your OS. What flavor of Linux do you run?
Upvotes: 3