mongodump是否锁定数据库? [英] Does mongodump lock the database?

查看:487
本文介绍了mongodump是否锁定数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为mongo设置备份策略,只是好奇地知道mongodump是否在执行数据库转储之前锁定了数据库?

I'm in the middle of setting up a backup strategy for mongo, was just curious to know if mongodump locks the database before performing the database dump?

推荐答案

Mongdump不会锁定数据库.这意味着其他读取和写入操作将继续正常进行.

Mongdump does not lock the db. It means other read and write operations will continue normally.

实际上,mongodump和mongorestore都是非阻塞的.因此,如果您想mongodump mongorestore一个数据库,那么您有责任确保它确实是所需的快照备份/还原.为此,您必须在使用mongodump/mongorestore进行备份/还原备份时停止所有其他写操作.如果您正在运行分片环境,则建议您也停止平衡器.

Actually, both mongodump and mongorestore are non-blocking. So if you want to mongodump mongorestore a db then its your responsibility to make sure that it is really a desired snapshot backup/restore. To do this, you must stop all other write operations while taking/restoring backups with mongodump/mongorestore. If you are running a sharded environment then its recommended you stop the balancer also.

这篇关于mongodump是否锁定数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆