mpalmer / lvmsync

Synchronise LVM LVs across a network by sending only snapshotted changes
http://theshed.hezmatt.org/lvmsync
GNU General Public License v3.0
380 stars 60 forks source link

Handshake failed; protocol mismatch? #22

Closed WMP closed 9 years ago

WMP commented 10 years ago

Hello, i have lvmsync with patch to make possible backup lvm with "-": https://github.com/mpalmer/lvmsync/issues/13#issuecomment-44138009 . To do backups i execute this commands: on server2:

lvcreate -L 50G vg0 -n compile-disk

on server1:

lvcreate --snapshot -L10G -n compile-disk-snapback virtual/compile-disk
dd if=/dev/virtual/compile-disk-snapback bs=1M | pv -ptrb | ssh root@backup dd of=/dev/vg0/compile-disk
lvcreate --snapshot -L10G -n compile-disk-snapback-new virtual/compile-disk
lvmsync /dev/virtual/compile-disk-snapback backup:/dev/vg0/compile-disk --snapback \
     /var/snapbacks/compile-disk.$(date +%Y%m%d-%H%M)
lvremove -f virtual/compile-disk-snapback
lvrename virtual/compile-disk-snapback-new compile-disk-snapback

When i want to restore backup, i trying on server2:

lvmsync --apply /var/snapbacks/compile-disk.20140731-1955 /dev/vg0/compile-disk

but i have error:

Handshake failed; protocol mismatch? (saw '����' expected 'lvmsync PROTO[2]'

Anyone can help me?

mpalmer commented 9 years ago

Smells like --snapback isn't writing the appropriate header before dumping out the change data. I'll add it to my list of things to take a look at.

WMP commented 9 years ago

How can i help you to debug this? And, is other method to make differential backup?

mpalmer commented 9 years ago

I don't think there's anything you can do to help at this point, unless you dig into the code and work up a patch. I've got to test --snapback for myself and see what it's doing wrong, if anything; if I can't reproduce the issue, then I'll need to talk with you further to work out what we're doing differently.