我是个新手,在使用mongodb的phant上找不到合适的文档。因为我有很多数据,所以发生了内存溢出。最后,我陷入了以下错误:
HTTP output: { [Error: EMFILE, open 'phant_streams/4d16/83403f7611e5810d57f88174fbef/stream.csv']
errno: -24,
code: 'EMFILE',
path: 'phant_streams/4d16/83403f7611e5810d57f88174fbef/stream.csv' }
events.js:87
throw Error('Uncaught, unspecified "error" event.');
^
Error: Uncaught, unspecified "error" event.
at Error (native)
at Function.emit (events.js:87:13)
at Function.<anonymous> (/usr/lib/node_modules/phant/node_modules/phant-manager-http/index.js:237:12)
at PhantMeta.<anonymous> (/usr/lib/node_modules/phant/node_modules/phant-meta-nedb/lib/phant-meta-nedb.js:243:14)
at callback (/usr/lib/node_modules/phant/node_modules/phant-meta-nedb/node_modules/nedb/lib/executor.js:30:17)
at /usr/lib/node_modules/phant/node_modules/phant-meta-nedb/node_modules/nedb/lib/datastore.js:536:25
at /usr/lib/node_modules/phant/node_modules/phant-meta-nedb/node_modules/nedb/lib/persistence.js:201:12
at fs.js:1077:21
at FSReqWrap.oncomplete (fs.js:95:15)除了这一点,有时还会发生以下错误:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory这就是为什么我想使用mongodb来防止这个错误。我对此进行了搜索,最终找到了mongodb的sparckfun库:https://github.com/sparkfun/phant-stream-mongodb
我安装了这个,但什么都没有发生,因为数据仍然不是字符串到mongo中。那么,我如何将phant数据存储到mongodb中呢?
发布于 2015-10-09 20:00:14
我遇到了同样的问题,特别是试图在Heroku上部署我自己的Phant实例(因为我想绕过Sparkfun的50Mb限制)。在对mongodb和mongoose库的版本进行了一些尝试之后,我成功地派生并修改了它们的存储库,以便您可以在本地运行它,也可以直接在heroku上部署它(只需确保您提供了一个MongoLab附加组件)。在这里查看我的分支:https://github.com/davidlago/phant
希望这能有所帮助!
https://stackoverflow.com/questions/32054142
复制相似问题