zoukankan      html  css  js  c++  java
  • mongodb备份恢复

    [root@mysql books]# mongorestore   -h  172.31.17.90:27017  --drop   -d  books    --directoryperdb   /data/ifly_temp/books

    恢复

    备份
      mongodump  -h  172.18.21.52  -d books  -o  /home/
      mongodump  -h  172.18.21.52  -d resources  -o  /home/
     mongodump  -h  172.18.21.52  -d categories  -o  /home/

     ./mongodump -h 172.16.46.12  -d books  -o /data/ifly_backup/

        ./mongodump -h 172.16.46.12  -d resources  -o /data/ifly_backup/

    bg   后台执行

    -bash: bg: job 1 already in background
    [root@mysql2 bin]# 2017-07-20T18:17:47.185+0800   Progress: 64380093118/144979209691 44% (bytes)
    2017-07-20T18:17:50.374+0800   Progress: 64391643380/144979209691 44% (bytes)
    2017-07-20T18:17:53.070+0800   Progress: 64395428591/144979209691 44% (bytes)
    fg  后台转前台
    ./mongorestore -h 172.16.128.231 --port 27017 -d resources --directoryperdb /ziyuan/ah_hb_resource/mongobak20170708/resources/
    2017-07-20T18:17:58.138+0800   Progress: 64396308782/144979209691 44% (bytes)
    2017-07-20T18:18:01.177+0800   Progress: 64399344764/144979209691 44% (bytes)
    2017-07-20T18:18:04.014+0800   Progress: 64414049516/144979209691 44% (bytes)
    2017-07-20T18:18:07.054+0800   Progress: 64423828671/144979209691 44% (bytes)
    2017-07-20T18:18:10.546+0800   Progress: 64438145393/144979209691 44% (bytes)
    2017-07-20T18:18:13.008+0800   Progress: 64447946426/144979209691 44% (bytes)
    2017-07-20T18:18:16.211+0800   Progress: 64459557918/144979209691 44% (bytes)
    2017-07-20T18:18:19.219+0800   Progress: 64470423175/144979209691 44% (bytes)
    2017-07-20T18:18:22.031+0800   Progress: 64480027362/144979209691 44% (bytes)
    2017-07-20T18:18:28.776+0800   Progress: 64490600634/144979209691 44% (bytes)
    2017-07-20T18:18:31.182+0800   Progress: 64500788206/144979209691 44% (bytes)
    ^Z  (ctrl+z)  停止任务
    [1]+  Stopped                 ./mongorestore -h 172.16.128.231 --port 27017 -d resources --directoryperdb /ziyuan/ah_hb_resource/mongobak20170708/resources/

  • 相关阅读:
    每日总结2.26
    《梦断代码》阅读笔记三
    每日总结2.25
    每日总结2.24
    每日总结2.23
    每日总结2.22
    每日总结2.19
    《梦断代码》阅读笔记二
    Java-11 形参和实参
    Java-10 final用法
  • 原文地址:https://www.cnblogs.com/vzhangxk/p/15303318.html
Copyright © 2011-2022 走看看