I'm trying to mirror a large Mongo database between from a production server to a dev environment by stopping Mongo on both servers and then running the command:
rsync --archive --delete --recursive --verbose --compress --rsh "ssh -t -o StrictHostKeyChecking=no -i key.pem" remoteuser@remotehost:/var/lib/mongodb/ /var/lib/mongodb
It runs fine for a few minutes, but then stopped with the error:
receiving incremental file list ./ collection-228--5129329295041693519.wt inflate returned -3 (0 bytes) rsync error: error in rsync protocol data stream (code 12) at token.c(557) [receiver=3.1.1] rsync: [generator] write error: Broken pipe (32) rsync error: error in socket IO (code 10) at io.c(820) [generator=3.1.1]
Googling the error suggests it's some sort of network connection problem, but I'm able to connect to both servers just fine.
If I re-run the command, it fails at the exact same file with the same error message. What's causing this error and how do I fix it?