答案 0 :(得分:1)
Topology was destroyed
错误出现,当mongodb正在写东西并且连接在中间被关闭/中断时。
看看引发该错误的code:
Mongos.prototype.insert = function(ns, ops, options, callback) {
if(typeof options == 'function') callback = options, options = {}, options = options || {};
if(this.state == DESTROYED) return callback(new MongoError(f('topology was destroyed')));
// Not connected but we have a disconnecthandler
if(!this.isConnected() && this.s.disconnectHandler != null) {
return this.s.disconnectHandler.add('insert', ns, ops, options, callback);
}
// No mongos proxy available
if(!this.isConnected()) {
return callback(new MongoError('no mongos proxy available'));
}
// Execute write operation
executeWriteOperation(this, 'insert', ns, ops, options, callback);
}
解决方案:
为了安全起见,也请重新启动mongodb和MongoDB指南针,并且您应该能够创建集合而不会出现任何错误。