Percona-Lab / mongodb_consistent_backup

A tool for performing consistent backups of MongoDB Clusters or Replica Sets
https://www.percona.com
Apache License 2.0
276 stars 81 forks source link

Allow specifying preferred replica set members #291

Closed dschneller closed 5 years ago

dschneller commented 5 years ago

Sometimes it is helpful to specify one or more preferred replica set secondaries explicitly, for example when you for some reason cannot or don't want to tag instances, but still have a clear preference from which servers you want your backup to read.

This patch adds a new --replication.preferred_members parameter that expects one or more replica set members in the form replset-name/host:port. If a host matches on of the names specified (separated by commas), they get their score bumped to ensure they are the chosen backup source.

Again: Please excuse the messy history. GitHub has broken clean PR workflows.