English 中文(简体)
Mongo 亚洲开发银行连接起来。 [当选 Error:link ECONNREFUSED •1:27017
原标题:MongoDB doesn t connect. [MongooseServerSelectionError: connect ECONNREFUSED ::1:27017]

<><>>>说明: 我已经走过以下类似路,并尝试了以下选择:。

  1. Restarted the MongoDB service.
  2. Replaced localhost by 0.0.0.0.
  3. Replaced local host by 127.0.0.1:27017

https://stackoverflow.com/questions/70045495/timeouteror-mongoserverselectioneror-joint-econnrezzed-127017-node> Error:Link ECONNREFUSED •1:27017 - [NodeJS + MongoDB]

https://stackoverflow.com/questions/50173080/mongonetworkeror-failed-to-link-to-server- localhost27017-on-first-connec>MongoNetworkError:未与服务器连接[当地:27017],第一个链接[MongoNetworkError:链接ECONNREFUSED 1270.0.1:27017]

https://stackoverflow.com/questions/69840504/mongooseserverselectionerror-link-econnrezzed-127017> • 1 27017

误差:

www.un.org/Depts/DGACM/index_spanish.htm 如下:。

const mongoose = require("mongoose");
mongoose.connect("mongodb://localhost/db_c");

<<>Nodjs>:>><>>>>>>>>><>strong>v18.13.0<><>>>>

www.un.org/Depts/DGACM/index_spanish.htm 我发现的错误是:。

E:
odejsapp1
ode_modulesmongooselibconnection.js:792
    err = new ServerSelectionError();
          ^

MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
    at _handleConnectionErrors (E:
odejsapp1
ode_modulesmongooselibconnection.js:792:11)   
    at NativeConnection.openUri (E:
odejsapp1
ode_modulesmongooselibconnection.js:767:11) {
  reason: TopologyDescription {
    type:  Unknown ,
    servers: Map(1) {
       localhost:27017  => ServerDescription {
        address:  localhost:27017 ,
        type:  Unknown ,
        hosts: [],
        passives: [],
        arbiters: [],
        tags: {},
        minWireVersion: 0,
        maxWireVersion: 0,
        roundTripTime: -1,
        lastUpdateTime: 1981963039,
        lastWriteDate: 0,
        error: MongoNetworkError: connect ECONNREFUSED ::1:27017
            at connectionFailureError (E:
odejsapp1
ode_modulesmongodblibcmapconnect.js:370:20)            at Socket.<anonymous> (E:
odejsapp1
ode_modulesmongodblibcmapconnect.js:293:22)    
            at Object.onceWrapper (node:events:628:26)
            at Socket.emit (node:events:513:28)
            at emitErrorNT (node:internal/streams/destroy:151:8)
            at emitErrorCloseNT (node:internal/streams/destroy:116:3)
            at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
          cause: Error: connect ECONNREFUSED ::1:27017
              at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16) {
            errno: -4078,
            code:  ECONNREFUSED ,
            syscall:  connect ,
            address:  ::1 ,
            port: 27017
          },
          [Symbol(errorLabels)]: Set(1) {  ResetPool  }
        },
        topologyVersion: null,
        setName: null,
        setVersion: null,
        electionId: null,
        logicalSessionTimeoutMinutes: null,
        primary: null,
        me: null,
         $clusterTime : null
      }
    },
    stale: false,
    compatible: true,
PS E:
odejsapp1> node index.js
E:
odejsapp1
ode_modulesmongooselibconnection.js:792
    err = new ServerSelectionError();
          ^

MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
    at _handleConnectionErrors (E:
odejsapp1
ode_modulesmongooselibconnection.js:792:11)   
    at NativeConnection.openUri (E:
odejsapp1
ode_modulesmongooselibconnection.js:767:11) {
  reason: TopologyDescription {
    type:  Unknown ,
    servers: Map(1) {
       localhost:27017  => ServerDescription {
        address:  localhost:27017 ,
        type:  Unknown ,
        hosts: [],
        passives: [],
        arbiters: [],
        tags: {},
        minWireVersion: 0,
        maxWireVersion: 0,
        roundTripTime: -1,
        lastUpdateTime: 101790,
        lastWriteDate: 0,
        error: MongoNetworkError: connect ECONNREFUSED ::1:27017
            at connectionFailureError (E:
odejsapp1
ode_modulesmongodblibcmapconnect.js:370:20)       
            at Socket.<anonymous> (E:
odejsapp1
ode_modulesmongodblibcmapconnect.js:293:22)
            at Object.onceWrapper (node:events:628:26)
            at Socket.emit (node:events:513:28)
            at emitErrorNT (node:internal/streams/destroy:151:8)
            at emitErrorCloseNT (node:internal/streams/destroy:116:3)
            at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
          cause: Error: connect ECONNREFUSED ::1:27017
              at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16) {
            errno: -4078,
            code:  ECONNREFUSED ,
            syscall:  connect ,
            address:  ::1 ,
            port: 27017
          },
          [Symbol(errorLabels)]: Set(1) {  ResetPool  }
        },
        topologyVersion: null,
        setName: null,
        setVersion: null,
        electionId: null,
        logicalSessionTimeoutMinutes: null,
        primary: null,
        me: null,
         $clusterTime : null
      }
    },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    maxSetVersion: null,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined
}

PS E:
odejsapp1> node index.js      
E:
odejsapp1
ode_modulesmongooselibconnection.js:792
    err = new ServerSelectionError();
          ^

MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
    at _handleConnectionErrors (E:
odejsapp1
ode_modulesmongooselibconnection.js:792:11)   
    at NativeConnection.openUri (E:
odejsapp1
ode_modulesmongooselibconnection.js:767:11) {
  reason: TopologyDescription {
    type:  Unknown ,
    servers: Map(1) {
       localhost:27017  => ServerDescription {
        address:  localhost:27017 ,
        type:  Unknown ,
        hosts: [],
        passives: [],
        arbiters: [],
        tags: {},
        minWireVersion: 0,
        maxWireVersion: 0,
        roundTripTime: -1,
        lastUpdateTime: 945032,
        lastWriteDate: 0,
        error: MongoNetworkError: connect ECONNREFUSED ::1:27017
            at connectionFailureError (E:
odejsapp1
ode_modulesmongoose
ode_modulesmongodblibcmapconnect.js:370:20)
            at Socket.<anonymous> (E:
odejsapp1
ode_modulesmongoose
ode_modulesmongodblibcmapconnect.js:293:22)
            at Object.onceWrapper (node:events:628:26)
            at Socket.emit (node:events:513:28)
            at emitErrorNT (node:internal/streams/destroy:151:8)
            at emitErrorCloseNT (node:internal/streams/destroy:116:3)
            at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
          cause: Error: connect ECONNREFUSED ::1:27017
              at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16) {
            errno: -4078,
            code:  ECONNREFUSED ,
            syscall:  connect ,
            address:  ::1 ,
            port: 27017
          },
          [Symbol(errorLabels)]: Set(1) {  ResetPool  }
        },
        topologyVersion: null,
        setName: null,
        setVersion: null,
        electionId: null,
        logicalSessionTimeoutMinutes: null,
        primary: null,
        me: null,
         $clusterTime : null
      }
    },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: null,
    maxElectionId: null,
    maxSetVersion: null,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined
}

我是绝对的开端,寻求你们的帮助。

问题回答

我也存在与第18.16.0号相同的联系问题。 我将其降级为16.13.0,罚款。





相关问题
Access DB Ref MongoDB

Whats the best way to access/query a DB Ref: UPDATE: users: name, groupref : {$ref:"groups",$id:"ObjectId ..." } } groups: name, topic, country,...,.. Assumption is that user belongs to only one ...

MongoDB nested sets

What re the best practices to store nested sets (like trees of comments) in MongoDB? I mean, every comment can have a parent comment and children-comments (answers). Storing them like this: { ...

MongoMapper and migrations

I m building a Rails application using MongoDB as the back-end and MongoMapper as the ORM tool. Suppose in version 1, I define the following model: class SomeModel include MongoMapper::Document ...

MongoDB takes long for indexing

I have the following setup: Mac Pro with 2 GB of RAM (yes, not that much) MongoDB 1.1.3 64-bit 8 million entries in a single collection index for one field (integer) wanted Calling .ensureIndex(...) ...

Storing and accessing large amounts of data

My application creates pieces of data that, in xml, would look like this: <resource url="someurl"> <term> <name>somename</name> <frequency>somenumber</...

热门标签