4、MongoDB學習之備份還原

來源:互聯網
上載者:User

標籤:direct   備份還原   bin   增量   集合   alt   還需   127.0.0.1   成功   

一、MongoDB備份1、MongoDB整庫備份備份資料使用下面的命令mongodump -h dbhost -d dbname -o dbdirectory 備份user資料庫[[email protected] bin]# ./mongodump -h127.0.0.1 -d user -o /home/

 

[[email protected] bin]# ls /home/user/b3.bson  b3.metadata.json  c1.bson  c1.metadata.json#可以看到備份的檔案了 2、MongoDB單個集合備份備份test庫下面的c1集合[[email protected] bin]# ./mongodump -h127.0.0.1 -d test -c c1 -o /tmp/

 

 二、MongoDB還原1;單庫還原[[email protected] bin]# ./mongorestore -h 127.0.0.1:27017 -d user /home/user/ #用戶端查看到整個user資料庫已經還原成功了 

 

2;單集合還原[[email protected] bin]# ./mongorestore -h 127.0.0.1:27017 -d test  /tmp/test/ #單集合還原也是不需要制定具體集合名稱 

 

總結:mongodb以上備份還原只針對全量備份,增量備份後續還需要研究   

4、MongoDB學習之備份還原

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.