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

萝らか妹 提交于 2019-11-30 06:46:56

问题


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?


回答1:


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



回答2:


Uninstall mongodb using

sudo apt-get autoremove mongodb-*

then install with

apt-get install mongodb-server

run mongo
it will solve the problem



来源:https://stackoverflow.com/questions/18180106/mopederrorsconnectionfailure-could-not-connect-to-any-secondary-or-primary-n

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!