推荐工具
RoboMongo
推荐书目
50 Tips and Tricks for MongoDB Developers
Related Blogs
Snail in a Turtleneck
pancts
V2EX  ›  MongoDB

有没有什么快速的方法导出 mongodb 的数据?

  •  
  •   pancts · Nov 29, 2015 · 5513 views
    This topic created in 3861 days ago, the information mentioned may be changed or developed.

    用自带的工具导出 json 或者 csv 都太慢了

    cpu 和内存都没怎么变化两天才导出 30g 数据

    大概需要导出五千万条,请问有什么办法么

    8 replies    2015-11-30 11:05:08 +08:00
    fractal314
        1
    fractal314  
       Nov 29, 2015
    多找几台机子,自己写个脚本试试呢?
    matthewz
        2
    matthewz  
       Nov 29, 2015   ❤️ 1
    Unfortunately, It's a feature of MongoDB

    copy the files in your database directory itself (default /data/db) rather than using mongodump/mongoresotre. If you can shut down your database for periods of time, this is best. Otherwise, you have to use file system snapshots or similar. See this for more the official mongo blurb: http://docs.mongodb.org/manual/core/backups/
    TJT
        3
    TJT  
       Nov 29, 2015 via Android
    多进程和分布式
    zzlyzq
        4
    zzlyzq  
       Nov 30, 2015 via Android   ❤️ 1
    如果是 replica set 模式,可以搞出来一个 secondary 然后移花接木
    pancts
        5
    pancts  
    OP
       Nov 30, 2015
    @TJT 单线程都会溢出。。可能是翻页的问题 还需要优化
    pancts
        6
    pancts  
    OP
       Nov 30, 2015
    @fractal314 分布式嘛。。资金短缺。。
    pancts
        7
    pancts  
    OP
       Nov 30, 2015
    pancts
        8
    pancts  
    OP
       Nov 30, 2015
    @zzlyzq 目前只有这个办法了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4948 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 09:39 · PVG 17:39 · LAX 02:39 · JFK 05:39
    ♥ Do have faith in what you're doing.