[英]Mongodb Sharding Backup / Restore
We are using mongodb sharding in production server and having 2 sharding and 3 replica set including arbitor on each shard. 我们在生产服务器中使用mongodb分片,并且在每个分片上有2个分片和3个副本集,包括仲裁者。 Records also distributed based on write request. 记录也基于写请求分发。 But we have to know how will take a backup, because we are having more then 50Lks records in mondodb. 但我们必须知道如何进行备份,因为我们在mondodb中拥有超过50Lks的记录。 So we need to take a records. 所以我们需要记录。 Actually at present we are taking backup using mongodump in each shard server using primary IP and port. 实际上,目前我们正在使用主要IP和端口在每个分片服务器中使用mongodump进行备份。
Each time we need to take a backup on each shard server, incase on future i will add one more shard the same process we need to do on that server also. 每次我们需要在每个分片服务器上进行备份时,未来我将添加一个分片,我们还需要在该服务器上执行相同的过程。 So please share your input if any other possiblities using mongos. 因此,如果使用mongos有任何其他可能性,请分享您的输入。
Regards, Kumaran 此致,库马兰
下面是一些使用LVM快照创建一致的mongodb分片群集备份的python代码: https : //github.com/knyar/mongoclusterscripts/tree/master/mongo-backup
Take a look at this: 看看这个:
Backing Up Sharded Cluster . 备份分片群集 。
In short: 简而言之:
for small clusters you can just use mongodump
against mongos
. 对于小型集群,您可以使用mongodump
对抗mongos
。
backing up larger clusters will involve running mongodump
on individual shards. 备份较大的集群将涉及在单个分片上运行mongodump
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.