简体   繁体   English

MongoDB-减少WiredTiger文件大小

[英]MongoDB - Reduce WiredTiger Filesize

I'm making a web app with the MEAN Stack, and I'm having issues with version control. 我正在使用MEAN Stack制作Web应用程序,但是版本控制出现问题。

I'm trying to push to a repo on Github Enterprise, and because of the "apparent" sizes of my WiredTiger files (which you can see here) 我正在尝试在Github Enterprise上进行回购,并且由于WiredTiger文件的“明显”大小(您可以在此处看到)

I'm getting this error: 我收到此错误:

remote: error: File data/db/journal/WiredTigerPreplog.0000000002 is 100.00 MB; 远程:错误:文件数据/db/journal/WiredTigerPreplog.0000000002为100.00 MB; this exceeds GitHub Enterprise's file size limit of 100.00 MB 这超出了GitHub Enterprise的文件大小限制100.00 MB

Is there anyway to configure these files to hold less "apparent" space?? 无论如何,有没有配置这些文件以容纳更少的“表观”空间?

You would not store binary files into a source code management system. 您不会将二进制文件存储到源代码管理系统中。 While git has Large File Storage , checking in binary files of MongoDB is not exactly a good idea. 虽然git 具有 大文件存储空间 ,但签入MongoDB的二进制文件并不是一个好主意。 Usually, you would check in a text file representation of your initial data (for example JSON or CVS) and add it to your database on startup of your application. 通常,您将签入初始数据的文本文件表示形式(例如JSON或CVS),并在启动应用程序时将其添加到数据库中。

If you really need to keep the database files for deployment, then I would take a different approach and use Docker: Fill your database, stop the container, docker commit the container and use the resulting container for deployment. 如果您确实需要保留数据库文件以进行部署,那么我将采用另一种方法并使用Docker:填充数据库,停止容器, docker commit容器,然后使用生成的容器进行部署。 Note that this is not ideal, either. 请注意,这也不理想。

These are journaling files from mongodb, instead of pushing these files to version control. 这些是mongodb的日志文件,而不是将这些文件推送到版本控制。 Store it on some 3rd party hosting provider or locally if the hosted server has enough space for production environment. 如果托管的服务器有足够的空间用于生产环境,则将其存储在某个第三方托管服务提供商或本地。 For dev environments, this should be disabled. 对于开发环境,应将其禁用。 If you don't need journaling, you can disable from mongo conf file. 如果不需要日记,则可以从mongo conf文件中禁用。 Also, i would suggest to read Journaling in Mongo 另外,我建议阅读Mongo中的Journaling

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM