gpt4 book ai didi

mongodb - 在 Ubuntu 15.10 上安装 Mongo 3.2.9

转载 作者:太空宇宙 更新时间:2023-11-03 17:10:28 25 4
gpt4 key购买 nike

我使用以下链接在 ubuntu 中安装了 mongodb https://askubuntu.com/questions/724749/install-mongo-3-2-on-ubuntu-15-10

root@karthickeyan:/home/karthickeyan# mongo
MongoDB shell version: 3.2.9
connecting to: test
2016-08-20T01:17:08.198+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2016-08-20T01:17:08.198+0530 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:229:14
@(connect):1:6

exception: connect failed

最佳答案

使用以下内容创建文件 /lib/systemd/system/mongod.service:

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf

[Install]
WantedBy=multi-user.target

启动服务:

sudo service mongodb start

然后运行命令:

mongo

然后您将访问服务器。希望对你有帮助。 :)

关于mongodb - 在 Ubuntu 15.10 上安装 Mongo 3.2.9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39046721/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com