russel053/ 一月 20, 2018/ VM, ZFS, 儲存/檔案系統

Main features

  • Speed limiter
  • Syncing interval can be set by cron
  • Syncing VM (disks and config) but also ZFS Datasets
  • Can keep multiple backups
  • Can be used in both directions
  • Can send on local host
  • Traffic is encrypted

預設Web 抄寫與 zsync 比較:

這邊重要的一點 zync 是不支援遷移的,另外主要是用在備份上面,不太適合HA。


安裝與使用:

apt-get install pve-zsync

開始傳送:

                      VMID    目標IP 儲存池 詳細列出狀態  快照數       名稱   每秒最大傳送速度(Byte)
pve-zsync sync –source 124 –dest IP:RAID –verbose –maxsnap 0 –name VM –limit 102400

接下來系統就會開始傳送VM檔

ssh [email protected] — zfs list -rt snapshot -Ho name IP:RAID/[email protected]_VM_2017-06-23_16:17:20

傳送完成之後就會顯示完成位置與容量大小

send from @ to RAID/[email protected]_VM_2017-06-23_16:18:00 estimated size is 59.5G
total estimated size is 59.5G

接下來傳送VM 配置檔案:

scp  /etc/pve/qemu-server/124.conf [email protected]:/etc/pve/qemu-server/

傳送完成之後編輯設定檔修改為當前Server 儲存池名稱:

virtio0: RAID:vm-124-disk-1,size=64G

例如: 
RAID:vm-124-disk-1,size=64G
改成
PCIeSSD:vm-124-disk-1,size=64G

定期作業:

pve-zsync create --source 192.168.1.1:100 --dest tank/backup --verbose --maxsnap 2 --name test1 --limit 512 --skip

排定在Crontab 裡面定時處理,請注意:

  • The –skip parameter disables the initial sync, that normally would be done immediately but can take a while, depending on the size of the backup. The initial sync will be done at the first sync time.

zsync 狀態:

[email protected]:~# pve-zsync list
SOURCE                   NAME           STATE LAST SYNC           TYPE 
192.168.15.95:100        testing1       ok     2015-05-13_14:44:00 ssh  
192.168.15.95:data/test1 testing1       syncing2015-05-13_14:44:11 ssh  

[email protected]:~# pve-zsync status
SOURCE                   NAME           STATUS 
192.168.15.95:100        testing1       ok    
192.168.15.95:data/test1 testing1       syncing

差異部分也可以使用zfs 快照傳送,重送方式如下:

zfs send <pool>/[<path>/]vm-<VMID>-disk-<number>@<last_snapshot> | [ssh [email protected]<destination>] zfs receive <pool>/<path>/vm-<VMID>-disk-<number>
Share this Post