刚刚完成安装 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 /)没有运气。
我很感激任何帮助。提前致谢!