Mongoose MongoError:拓扑已被破坏

时间:2015-12-15 14:20:03

标签: node.js mongodb mongoose

我正在运行MongoError"拓扑已被破坏"时。我的应用程序使用nodejs,mongodb,mongoose(4.1.3),express(4.13.3)。

要连接到服务器,我使用以下参数:

var con = mongoose.createConnection(baseUri, { 
    server: { 
        poolSize: 1 
    }, socketOptions: { 
        keepAlive: 1, 
        connectTimeoutMS: 10000 
    }});

我在日志文件中找到的内容:

/data/var/www/rk/node_modules/mongoose/node_modules/mongodb/lib/server.js:235
        process.nextTick(function() { throw err; })
                                      ^
MongoError: server localhost:27017 received an error {"name":"MongoError","message":"read ECONNRESET"}
    at null.<anonymous> (/data/var/www/rk/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:265:47)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at null.<anonymous> (/data/var/www/rk/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:77:12)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at Socket.<anonymous> (/data/var/www/rk/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:121:49)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at emitErrorNT (net.js:1253:8)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

有人能告诉我这个错误的含义以及我如何解决它?

感谢!!!

BR, 马丁

0 个答案:

没有答案