我重新启动我的计算机,试图更新它,在重新启动之前,我还在进行另一个项目。现在,我使用node.js后端的项目给了我这个错误:
reason: TopologyDescription {
type: 'Single',
setName: null,
maxSetVersion: null,
maxElectionId: null,
servers: Map(1) {
'localhost:27017' => ServerDescription {
address: 'localhost:27017',
error: Error: connect ECONNREFUSED 127.0.0.1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1132:16) {
name: 'MongoNetworkError'
},
roundTripTime: -1,
lastUpdateTime: 58154302,
lastWriteDate: null,
opTime: null,
type: 'Unknown',
topologyVersion: undefined,
minWireVersion: 0,
maxWireVersion: 0,
hosts: [],
passives: [],
arbiters: [],
tags: []
}
},
stale: false,
compatible: true,
compatibilityError: null,
logicalSessionTimeoutMinutes: null,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
commonWireVersion: null
}
我的mongodb指南针给了我:connect ECONNREFUSED 127.0.0.1:27017
。我的操作系统是macOS大苏尔。
在另一篇文章中,有人建议重新启动mongod
进程并重新连接。我试着按照这些指令mac-mongodb,但当我从一个新的终端,发出以下命令:mongosh
‘我的终端给了我command not found: mongosh
。我还试着用PATH="/usr/local/opt/mongodb-community@4.4/bin" mongo MongoDB shell version v4.4.13
测试它,但是Error: couldn't connect to server 127.0.0.1:27017,
的连接被拒绝了。
有人知道怎么解决这个问题吗?我真的很感谢你的帮助和建议。谢谢!
发布于 2022-11-09 15:52:53
重新启动mongodb帮助我:
brew services stop mongodb-community@5.0
brew services start mongodb-community@5.0
发布于 2022-09-04 09:38:35
这可能是由于mongoDB服务器停止而发生的。若要解决此问题,请转到任务管理器。在顶部栏中,单击“服务”。在设置的文件中搜索mongoDB。如果状态“停止”。右击并开始运行服务器。它会再起作用的。要确认此操作,请打开cmd并键入mongosh
,您将得到连接结果。
https://stackoverflow.com/questions/72428495
复制相似问题