Closed WMP closed 10 years ago
I've written a new test case that specifically exercises --snapback
, and that appears to work OK, so I don't think anything's fundamentally broken with snapback. I've also tried to reproduce the problem you're having using your script, and I'm afraid I'm not having any luck.
As part of my attempts, I've significantly improved the way that problems in the receiving lvmsync are reported -- now it should be much more obvious when things go wrong on the remote end -- which is the most likely cause of the problem you're seeing. These changes are available in the freshly-released 3.1.1 version. Also as part of that version I cleaned up a couple of corner cases in the receiver, so it's possible that things might "just work" for you now. If they don't, though, at least there should be some more useful information about what went wrong.
Ok, on source server i have ruby 2.1.1 from rvm, and on backup i have 2.0.0. This is output:
root@gaja ~/lvmsync # ./lvmsync_diff.sh
Logical volume "test-snapshot" created
creating file normal_test.20141011-2214
creating file snapshot_test.20141011-2214
lvmsync...
Origin device: /dev/mapper/virtual-test
Sending chunk 0..4095...
Seeking to 0 in /dev/mapper/virtual-test
Remote prematurely closed the connection
/usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:210:in `readline': end of file reached (EOFError)
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:210:in `block (3 levels) in run_client'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:208:in `each'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:208:in `block (2 levels) in run_client'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:254:in `rescue in block (2 levels) in dump_changes'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:249:in `block (2 levels) in dump_changes'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:239:in `each'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:239:in `block in dump_changes'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:238:in `open'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:238:in `dump_changes'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:204:in `block in run_client'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open3.rb:199:in `popen_run'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open3.rb:93:in `popen3'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:203:in `run_client'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:106:in `main'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.1/bin/lvmsync:296:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.1.1/bin/lvmsync:23:in `load'
from /usr/local/rvm/gems/ruby-2.1.1/bin/lvmsync:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
lvmsync done
cleanup
Logical volume "test-snapshot" successfully removed
So it looks like there's definitely a problem with the receiving lvmsync crashing out early ("Remote prematurely closed the connection"), but obviously the code to read from the pipe and display the remote's output isn't robust enough. Try again with the newly released 3.1.3, and we'll see if something more useful appears.
root@gaja ~/lvmsync # ./lvmsync_diff.sh
Logical volume "test-snapshot" already exists in volume group "virtual"
creating file normal_test.20141012-0936
creating file snapshot_test.20141012-0936
lvmsync...
Origin device: /dev/mapper/virtual-test
Sending chunk 0..4095...
Seeking to 0 in /dev/mapper/virtual-test
Remote prematurely closed the connection
remote:ERROR: No snapshot specified. Exiting.
^C/usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:208:in `select': Interrupt
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:208:in `block (2 levels) in run_client'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:258:in `rescue in block (2 levels) in dump_changes'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:253:in `block (2 levels) in dump_changes'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:243:in `each'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:243:in `block in dump_changes'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:242:in `open'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:242:in `dump_changes'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:204:in `block in run_client'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open3.rb:199:in `popen_run'
from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open3.rb:93:in `popen3'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:203:in `run_client'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:106:in `main'
from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:300:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.1.1/bin/lvmsync:23:in `load'
from /usr/local/rvm/gems/ruby-2.1.1/bin/lvmsync:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
root@gaja ~/lvmsync #
In backup server i have file /usr/local/bin/lvmsync:
#!/usr/bin/env bash
# load rvm ruby
source /usr/local/rvm/environments/ruby-2.0.0-p576
ruby /usr/local/rvm/gems/ruby-2.0.0-p576/bin/lvmsync
Sorry, i add to my lvmsync $@ and works good! All works :D
Hello, on version 3.1.0 finally lvmsync can send chunks to other server :D, but new files isn't on backup server. In addition, can not save snapback files: