刚刚开始在Ubuntu 14.04znapzend
上编译良好(源机器,因为更新到 Ubuntu 16.04)。目标机器是 Ubuntu 16.04('backupserver')。我已经使用/设置了一个非密码 ssh 密钥对。我可以不用密码就好了。问题是,由于某种原因似乎无法到达备份服务器。mbuffer 在两台机器上都在。这是我在源机器上运行的命令和输出:ssh-keygen
ssh-copy-id [destination]
ssh backupserver
znapzend
/usr/bin/mbuffer
znapzendzetup
sudo znapzendzetup create --recursive --mbuffer=/usr/bin/mbuffer --tsformat='%Y-%m-%d-%H%M%S' SRC '1y=>1d' pool/Documents DST '1y=>1d' jon@backupserver:pool/Documents
Host key verification failed.
Host key verification failed.
*** WARNING: executable '/usr/bin/mbuffer' does not exist on jon@backupserver
*** backup plan: pool/Documents ***
dst_0 = jon@backupserver:pool/Documents
dst_0_plan = 1year=>1day
*** WARNING: destination 'jon@backupserver:pool/Documents' does not exist, will be ignored! ***
enabled = on
mbuffer = /usr/bin/mbuffer
mbuffer_size = 1G
post_znap_cmd = off
pre_znap_cmd = off
recursive = on
src = pool/Documents
src_plan = 1year=>1day
tsformat = %Y-%m-%d-%H%M%S
Do you want to save this backup set [y/N]?
感谢您提供的任何见解!
更新#1
我得到:
Host key verification failed.
或者
Permission denied the ZFS utilities must be run as root.
取决于我是使用 sudo 运行 znapzendzetup,还是在命令中有 --sudo:
sudo znapzendzetup create ...
或者
znapzendzetup create --sudo ...
我将此行添加到 /etc/sudoers(通过 visudo):
jon ALL=(ALL) NOPASSWD:ALL
并在主机和目标机器上执行这一行:
sudo zfs allow -u jon create,mount,send,receive,snapshot,destroy pool/Documents
我可以尝试启用无密码 root 登录,但我知道这是不鼓励的。谢谢参观!
更新#2
我通过更改目标计算机上的 /etc/ssh/sshd_confg 中的这些行来启用远程 root 登录:
#PermitRootLogin prohibit-password
PermitRootLogin yes
然后,在源机器上:
sudo passwd root
su
ssh-keygen
ssh-copy-id BACKUPSERVER
znapzend 命令现在作为 sudo 工作,并且没有 --sudo 参数!
接下来,我启动了一个 znapzend 命令,输出如下:
jon@FILESERVER:~$ sudo znapzend --debug --runonce=pool/Documents
[Wed Apr 27 17:54:42 2016] [info] znapzend (PID=6388) starting up ...
[Wed Apr 27 17:54:42 2016] [info] refreshing backup plans...
[Wed Apr 27 17:54:42 2016] [info] found a valid backup plan for pool/Documents...
[Wed Apr 27 17:54:42 2016] [info] znapzend (PID=6388) initialized -- resuming normal operations.
[Wed Apr 27 17:54:42 2016] [debug] snapshot worker for pool/Documents spawned (6391)
[Wed Apr 27 17:54:42 2016] [info] creating snapshot on pool/Documents
# zfs snapshot pool/Documents@2016-04-27-175442
[Wed Apr 27 17:54:42 2016] [debug] snapshot worker for pool/Documents done (6391)
[Wed Apr 27 17:54:42 2016] [debug] send/receive worker for pool/Documents spawned (6393)
[Wed Apr 27 17:54:42 2016] [info] starting work on backupSet pool/Documents
# zfs list -H -o name -t snapshot -s creation -d 1 pool/Documents
[Wed Apr 27 17:54:42 2016] [debug] cleaning up snapshots on pool/Documents
# zfs destroy pool/Documents@2016-04-27-174027
[Wed Apr 27 17:54:43 2016] [info] done with backupset pool/Documents in 1 seconds
[Wed Apr 27 17:54:43 2016] [debug] send/receive worker for pool/Documents done (6393)
它似乎已经成功运行,但到目前为止,它还没有将数据集备份到目的地。它什么时候复制文件?
另外,仅供参考,我添加了 znapzend 作为服务:
sudo cp ~/znapzend-0.15.5/init/znapzend.service /etc/systemd/system
sudo chown root:root /etc/systemd/system/znapzend.service
systemctl enable znapzend.service
sudo systemctl enable znapzend.service
sudo systemctl start znapzend.service
sudo service znapzend status
谢谢!
更新#3
好的,我现在已经整理好了。我没有在目标机器上使用“root”登录的配置设置,这阻止了发送/接收功能。这是我更新的 znapzendzetup 命令:
sudo znapzendzetup create --mbuffer=/usr/bin/mbuffer --tsformat='%Y-%m-%d-%H%M%S' SRC '7d=>1h,1y=>1d' pool/Documents DST '7d=>1h,1y=>1d' root@BACKUPSERVER:pool/Documents
备份成功完成后:
sudo znapzend --debug --runonce=pool/Documents
感谢这个出色的 ZFS 快照+备份工具!!!