0

I'm running a hidden, priority 0 replica server as backup. I was wondering if it is possible to ignore commands like dropDatabase and removeJournalFiles on the backup server?

In my case it's safe to assume the backup server should not delete any of the replicated databases.

Blizz
  • 8,082
  • 2
  • 33
  • 53
  • A replica set member is no backup. That would be the same as saying that RAID is a file backup. What if an admin accidentally deleted data? A delayed member might be of some use for backup purposes, but there is no way around snapshots or dumps for a proper backup concept. – Markus W Mahlberg Feb 11 '17 at 06:40
  • Thank you for the remark. Obviously you are right and I'm not using it as "backup"-server" but rather as "source of the backups"-server. My question remains though. – Blizz Feb 11 '17 at 06:55

1 Answers1

0

Not directly, not using normal replication.

But if you do replication with "script", then you can do what ever you want. There is lot's of examples in the net where you read source opLog and then apply it to the destination database.

  • python script syncing oplog from source to destination
  • scripts what mongodb support uses, but you need to write own docmanager where you handle your self remove(self, document_id, namespace, timestamp) and handle_command(self, doc, namespace, timestamp).. So that remove, drop and dropDatabase commands are ignored.
JJussi
  • 1,540
  • 12
  • 12
  • Do you have an example of this? Any links? This could work for my purpose but I can't find anything about it at first glance. – Blizz Feb 11 '17 at 07:09