mongo命令没有在fedora上工作(mongo command not working on fedora)

编程入门 行业动态 更新时间:2024-10-27 05:35:36
mongo命令没有在fedora上工作(mongo command not working on fedora)

我使用dnf / yum安装了mongodb,然后尝试运行该命令

mongo meteor --eval“printjson(db.getCollectionNames())

,但我收到以下错误:

MongoDB shell版本:3.2.8连接到:meteor 2017-03-17T14:09:56.787 + 0200 W NETWORK [thread1]无法连接到127.0.0.1:27017,原因:错误:111连接被拒绝2017-03-17T14: 09:56.787 + 0200 E QUERY [thread1]错误:无法连接到服务器127.0.0.1:27017,连接尝试失败:connect@src/mongo/shell/mongo.js:229:14 @(connect):1: 6 异常:连接失败

我搜索了一个解决方案,但我找不到任何对我有用的东西。 请帮我解决错误。 谢谢。

I installed mongodb using dnf/yum and I then tried running the command

mongo meteor --eval "printjson(db.getCollectionNames())

,but I get the following error:

MongoDB shell version: 3.2.8 connecting to: meteor 2017-03-17T14:09:56.787+0200 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused 2017-03-17T14:09:56.787+0200 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

I searched for a solution but I couldn't find anything that worked for me. Please help me resolve the error. Thanks.

最满意答案

所以首先我在Fedora 24上。

我找到了这个帖子https://www.learntutors.com/install-mongodb-fedora-24/

我改变以使事情有效的唯一方法是对以下内容的安装命令

dnf install - 允许mongodb-org mongodb-org-server

这样就可以删除fedora 24附带的mongodb软件包,有利于mongodb-org mongodb-org-server。 希望这有助于其他人。 干杯。

So first I am on fedora 24.

I found this thread https://www.learntutors.com/install-mongodb-fedora-24/

The only thing I changed to make things work is the install command to the following

dnf install --allowerasing mongodb-org mongodb-org-server

This was so the mongodb package that ships with fedora 24 could be erased in favor of mongodb-org mongodb-org-server. Hope this helps someone else. cheers.

更多推荐

本文发布于:2023-07-14 23:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1108372.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令   工作   mongo   fedora   working

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!