mongodb数据库的备份和还原

mongodump备份

./mongodump -h 127.0.0.1:27017 --authenticationDatabase=admin -u admin -p 123qwe --authenticationMechanism=SCRAM-SHA-1 -d auth -o /data/hadoop/export/bp2_yn/cold/ >dump.log

mongodump还原

./mongorestore --host 127.0.0.1 --port 40000 --authenticationDatabase=admin  -u bigdata -p bigdata1q2w3e1q --authenticationMechanism=SCRAM-SHA-1 -d auth /data/hadoop/export/bp2_yn/cold/auth >restore.log

 

posted @ 2020-06-19 18:25  zhuanghutu  阅读(198)  评论(0)    收藏  举报
Fork me on GitHub