首頁 >資料庫 >mysql教程 >备份和恢复MongoDB

备份和恢复MongoDB

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-06-07 14:58:461086瀏覽

备份和恢复MongoDB 1 make sure all process which is writing mongodb are stopped. 2 dump database from GAMONGODB81 sudo ./mongodump --host gamongodb91:27017 --username GAEditor --password 9AEd!t0r --out /data/BondPrice_backup 3 compress back

备份和恢复MongoDB

 

1> make sure all process which is writing mongodb are stopped. 

2> dump database from GAMONGODB81 

    sudo ./mongodump --host gamongodb91:27017 --username 'GAEditor' --password '9AEd!t0r' --out /data/BondPrice_backup 
 

3> compress backup folder with tar, 1 hour 

   tar -cvf /data/BondPrice_backup.tar /data/Bondprice_backup 

4> copy tar file in dallas from B37, 5 hours 

    sudo scp msdomain1 

bhuang1@gamongodb81:/data/Bondprice_backup.tar /data/Bondprice_backup.tar 
 

5> Uncompress tar file, 0.5 hour 

   tar -xvf /data/Bondprice_backup.tar 

 

6> Drop connections from BondData 

 

      dbo.BondPrice.drop(); 

 

      dbo.IDCPrice.drop(); 

 

      dbo.ContractPrice.drop(); 

7> restore database with backup folder, 2 hours 

   sudo ./mongorestore /data/BondPrice_backup --host gamongodb61:27017 --username 'GAEditor' --password '9AEd!t0r'

 

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn