MongoDB 连接错误: MongoServerSelectionError: connect ECONNREFUSED 180.184.39.232:48354
at Topology.selectServer (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\sdam\topology.js:321:38)
at runNextTicks (node:internal/process/task_queues:65:5)
at listOnTimeout (node:internal/timers:555:9)
at process.processTimers (node:internal/timers:529:7)
at async Topology._connect (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\sdam\topology.js:200:28)
at async Topology.connect (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\sdam\topology.js:152:13)
at async topologyConnect (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\mongo_client.js:233:17)
at async MongoClient._connect (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\mongo_client.js:246:13)
at async MongoClient.connect (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\mongo_client.js:171:13)
at async NativeConnection.createClient (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongoose\lib\drivers\node-mongodb-native\connection.js:351:3) {
errorLabelSet: Set(0) {},
reason: TopologyDescription {
type: 'Single',
servers: Map(1) { 'dbconn.sealosbja.site:48354' => [ServerDescription] },
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
[cause]: MongoNetworkError: connect ECONNREFUSED 180.184.39.232:48354
at Socket.<anonymous> (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\cmap\connect.js:285:44)
at Object.onceWrapper (node:events:633:26)
at Socket.emit (node:events:518:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errorLabelSet: Set(1) { 'ResetPool' },
beforeHandshake: false,
[cause]: Error: connect ECONNREFUSED 180.184.39.232:48354
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '180.184.39.232',
port: 48354
}
}
}
D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongoose\lib\connection.js:1165
err = new ServerSelectionError();
^
MongooseServerSelectionError: connect ECONNREFUSED 180.184.39.232:48354
at _handleConnectionErrors (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongoose\lib\connection.js:1165:11)
at NativeConnection.openUri (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongoose\lib\connection.js:1096:11)
at runNextTicks (node:internal/process/task_queues:65:5)
at listOnTimeout (node:internal/timers:555:9)
at process.processTimers (node:internal/timers:529:7) {
errorLabelSet: Set(0) {},
reason: TopologyDescription {
type: 'Single',
servers: Map(1) {
'dbconn.sealosbja.site:48354' => ServerDescription {
address: 'dbconn.sealosbja.site:48354',
type: 'Unknown',
hosts: [],
passives: [],
arbiters: [],
tags: {},
minWireVersion: 0,
maxWireVersion: 0,
roundTripTime: -1,
minRoundTripTime: 0,
lastUpdateTime: 144818976,
lastWriteDate: 0,
error: MongoNetworkError: connect ECONNREFUSED 180.184.39.232:48354
at Socket.<anonymous> (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\cmap\connect.js:285:44)
at Object.onceWrapper (node:events:633:26)
at Socket.emit (node:events:518:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errorLabelSet: Set(1) { 'ResetPool' },
beforeHandshake: false,
[cause]: Error: connect ECONNREFUSED 180.184.39.232:48354
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '180.184.39.232',
port: 48354
}
},
topologyVersion: null,
setName: null,
setVersion: null,
electionId: null,
logicalSessionTimeoutMinutes: null,
maxMessageSizeBytes: null,
maxWriteBatchSize: null,
maxBsonObjectSize: null,
primary: null,
me: null,
'$clusterTime': null,
iscryptd: false
}
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
cause: TopologyDescription {
type: 'Single',
servers: Map(1) {
'dbconn.sealosbja.site:48354' => ServerDescription {
address: 'dbconn.sealosbja.site:48354',
type: 'Unknown',
hosts: [],
passives: [],
arbiters: [],
tags: {},
minWireVersion: 0,
maxWireVersion: 0,
roundTripTime: -1,
minRoundTripTime: 0,
lastUpdateTime: 144818976,
lastWriteDate: 0,
error: MongoNetworkError: connect ECONNREFUSED 180.184.39.232:48354
at Socket.<anonymous> (D:\ExpressLearning\express-locallibrary-tutorial\node_modules\mongodb\lib\cmap\connect.js:285:44)
at Object.onceWrapper (node:events:633:26)
at Socket.emit (node:events:518:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errorLabelSet: Set(1) { 'ResetPool' },
beforeHandshake: false,
[cause]: Error: connect ECONNREFUSED 180.184.39.232:48354
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '180.184.39.232',
port: 48354
}
},
topologyVersion: null,
setName: null,
setVersion: null,
electionId: null,
logicalSessionTimeoutMinutes: null,
maxMessageSizeBytes: null,
maxWriteBatchSize: null,
maxBsonObjectSize: null,
primary: null,
me: null,
'$clusterTime': null,
iscryptd: false
}
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
}
}
Node.js v22.14.0