刚刚使用完成安装mongodb
sudo yum install mongodb
但是当我尝试为Rails应用程序运行'mongo'时得到
[thiago@netbox mongoExample]$ mongo
MongoDB shell version: 2.2.4
connecting to: test
Wed Aug 21 16:07:56 exec error: src/mongo/shell/mongo.js:91 couldn't connect to server 127.0.0.1:27017
db = new Mongo().getDB( url );
^
exception: connect failed
我也尝试过:
[thiago@netbox mongoExample]$ service mongo start
Redirecting to /bin/systemctl start mongo.service
Failed to issue method call: Access denied
[thiago@netbox mongoExample]$ sudo service mongo start
[sudo] password for thiago:
Redirecting to /bin/systemctl start mongo.service
Failed to issue method call: Unit mongo.service failed to load: No such file or directory. See system logs and 'systemctl status mongo.service' for details.
[thiago@netbox mongoExample]$ systemctl status mongo.service
mongo.service
Loaded: error (Reason: No such file or directory)
Active: inactive (dead)
我尝试过他们的文档(http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/),但没有运气。
我非常感谢您的帮助。预先感谢!
sudo systemctl restart mongod.service