Janela de agendamento de backup para um cluster fragmentado autogerenciado
Nesta página
Visão geral
In a cluster fragmentado, the balancer process is responsible for distributing sharded data around the cluster, so that each estilhaço has roughly the same amount of data.
However, when creating backups from a sharded cluster it is important that you disable the balancer while taking backups to ensure that no chunk migrations affect the content of the backup captured by the backup procedure.
Observação
A desativação do balanceador só é necessária ao fazer backups manualmente, chamando mongodump
ou agendando uma tarefa que chame mongodump
em um horário específico.
Não é necessário desativar o balancer ao usar processos coordenados de backup e restauração:
Using the procedure outlined in the section Desabilitar o balancer you can manually stop the balancer process temporarily. As an alternative, you can use the following procedure to define a balancing window so that the balancer is always disabled during your automated backup operation.
Dica
Para usar mongodump
e mongorestore
como uma estratégia de backup para clusters fragmentados, consulte Fazer backup de um cluster fragmentado autogerenciado com um despejo de banco de dados.
Os clusters fragmentados também podem usar um dos seguintes processos coordenados de backup e restauração, que mantêm as garantias de atomicidade das transações entre shards:
Procedimento
If you have an automated backup schedule, you can disable all balancing operations for a period of time. For instance, consider the following command:
use config db.settings.updateOne( { _id : "balancer" }, { $set : { activeWindow : { start : "06:00", stop : "23:00" } } }, true )
This operation configures the balancer to run between 6:00am and 11:00pm, server time. Schedule your backup operation to run and complete outside of this time. Ensure that the backup can complete outside the window when the balancer is running and that the balancer can effectively balance the collection among the shards in the window allotted to each.