Sails应用程序无法连接localhost mongo db

时间:2019-03-06 12:38:37

标签: mongodb sails.js sails-mongo

我的Sails应用程序无法连接到本地运行的mongo数据库实例 local.js如下所示

module.exports.connections = {

  sailsMongoDBServer: {
        adapter: 'sails-mongo',
        host: '127.0.0.1',
        port: 27017,
        database: 'dp-manager-db'
      }
}

错误:

2019-03-06T12:32:01.081Z - error:
{ message:
   'The hook `orm` is taking too long to load.\nMake sure it is triggering its `initialize()` callback, or else set `sails.config.orm._hookTimeout to a higher value (currently 20000)',
  stack:
   'Error: The hook `orm` is taking too long to load.\nMake sure it is triggering its `initialize()` callback, or else set `sails.config.orm._hookTimeout to a higher value (currently 20000)\n    at Timeout.tooLong [as _onTimeout] (E:\\workspace_DpForm\\Eclipse\\dpm-app\\node_modules\\sails\\lib\\app\\private\\loadHooks.js:85:21)\n    at ontimeout (timers.js:436:11)\n    at tryOnTimeout (timers.js:300:5)\n    at listOnTimeout (timers.js:263:5)\n    at Timer.processTimers (timers.js:223:10)',
  code: 'E_HOOK_TIMEOUT' }
2019-03-06T12:32:03.521Z - error: A hook (`orm`) failed to load!
E:\workspace_DpForm\Eclipse\dpm-app\node_modules\mongodb\lib\mongo_client.js:224
          throw err

0 个答案:

没有答案