2

Trying to think of ways to speed up slave creation without master downtime.

The normal way of doing is:

  1. pg_start_backup
  2. rsync database files
  3. pg_stop_backup
  4. rsync wal files and start slave

Since 2 can take a long time over the network, is it safe to:

  1. rsync
  2. pg_start_backup
  3. rsync again
  4. pg_stop_backup
  5. rsync wal files and start slave

?

  • I never heard from pg_start_backup. I backup postgresql by pg_dump-ing it in directory format, and the saving it into git. – user259412 Nov 16 '18 at 16:56
0

Yes, entirely completely safe. The subsequent rsync will ensure that the data is aligned using the delta method.

One might want to ensure that there isn't an accumulation of irrelevant data files by using the --delete option (think carefully about what you are excluding) but this is a mostly separate issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.