总是有 Partner 希望以全命令行的方式,安装部署 Veeam Agent for Linux , 然后再连接到 VCC 云存储库。在这里我把平时的操作记录做了一个整理,方便大家实施时进行参考。

1. 安装前的准备工作


#install wget 

yum install wget

#Verify version installed  CentOS or Redhat
cat /etc/centos-release
    CentOS Linux release 7.5.1804 (Core)
    
cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.6 (Maipo)


#Update to latest 
yum update 

#verify kernel-devel is installed, else install it
yum list installed | grep kernel* 
#Around 74MB for kernel-devel
yum install kernel-devel


#install python3
yum install python3

#install lvm2
yum install lvm2

#install fuse-libs
yum install fuse-libs

2. 下载Veeam Agent for Linux 软件包

#download the rpm package form Veeam Reposiotry
wget http://repository.veeam.com/.private/rpm/el/7/x86_64/kmod-veeamsnap-4.0.0.1961-1.el7.x86_64.rpm
wget http://repository.veeam.com/.private/rpm/el/7/x86_64/veeam-4.0.0.1961-1.el7.x86_64.rpm

如果在安装python3 时遇到问题,可以参考我的另一篇文章
Veeam Agent for Linux 4.x 安装时遇到需要python3依赖.

3. 安装软件包

rpm -i <...>/kmod-veeamsnap-4.0.0.1961-1.el7.x86_64.rpm
rpm -i <...>/veeam-4.0.0.1961-1.el7.x86_64.rpm

4. 安装 Veeam 许可

[root@ip-172-31-18-8 ec2-user]# veeamconfig license install --path Veeam-1000instances-suite-trial.lic --server
License was installed successfully.
License information:
  License source: Local license
  Mode: Server
  Support expiration: 2020/05/02 (28 days left)
  Status: License is valid
  Issued to: JWI Innovation Software
  E-mail: george.yang@jwis.cn

5. 连接云端BaaS服务商


[root@ip-172-31-18-8 bin]# veeamconfig cloud add --name BaaS_SP --address 52.80.140.70 --port 6180 --login Scott --password tiger
Verification error: Self signed certificate
Cloud provider certificate information:
   Issuer: /OU=Veeam Software/O=Veeam Software/CN=Veeam Software
   Subject: /OU=Veeam Software/O=Veeam Software/CN=Veeam Software
   Version: 2
   Fingerprint: 0C9B5FB1DED9CBDC8297E092F5033A2CDBDFA1BF
Is this information correct?(yes/no): yes
Cloud Connect provider has been added successfully.

6.查看可用的存储库


[root@ip-172-31-18-8 bin]# veeamconfig repository list
Name                                     ID                                      Location    Type   Accessible  Backup server  
[52.80.140.70][Scott]Cloud repository 1  {976e39dc-6d61-4c23-b3e3-798f106c44e1}  BaaS_SP     cloud  true              

7. 定义备份任务

[root@ip-172-31-18-8 ec2-user]# veeamconfig job create volumelevel --name systembackup --reponame '[52.80.140.70][Scott]Cloud repository 1' --objects /dev/xvda2  --weekdays Mon,Sun --at 23:00 
Job has been created successfully.

8. 查看已经定义备份任务


[root@ip-172-31-18-8 ec2-user]# veeamconfig job list
Name          ID                                      Type         Repository                               
systembackup  {469169cb-9fc9-4b5a-afc7-8e562599f045}  VolumeLevel  [52.80.140.70][Scott]Cloud repository 1  

9. 执行备份任务


#首次执行备份任务是全量备份,之后再执行就是增量备份
[root@ip-172-31-18-8 ec2-user]# veeamconfig job start --name systembackup
Backup job has been started.
Session ID: [{5f4b9a94-5eff-44eb-a348-a2b1bfa1a8ca}].
Logs stored in: [/var/log/veeam/Backup/systembackup/Session_20200404_130954_{5f4b9a94-5eff-44eb-a348-a2b1bfa1a8ca}]

#如果想执行活动全量备份加, --activefull 参数
[root@ip-172-31-18-8 ec2-user]# veeamconfig job start --name systembackup --activefull
Backup job has been started.
Session ID: [{4d4c15e6-bbf5-4431-a6ec-6060d88e48b1}].
Logs stored in: [/var/log/veeam/Backup/systembackup/Session_20200409_052253_{4d4c15e6-bbf5-4431-a6ec-6060d88e48b1}].

10. 查看备份任务Session

[root@ip-172-31-18-8 ec2-user]# veeamconfig session list
Job name      Type    ID                                      State    Started at        Finished at       
systembackup  Backup  {5f4b9a94-5eff-44eb-a348-a2b1bfa1a8ca}  Success  2020-04-04 13:09  2020-04-04 13:10  
Total amount: 1
[root@ip-172-31-18-8 ec2-user]# 

11. 查看备份任务 Session Log

[root@ip-172-31-18-8 ec2-user]# veeamconfig session log --id 5f4b9a94-5eff-44eb-a348-a2b1bfa1a8ca
2020-04-04 13:09:54 UTC {7e8935e9-1796-4599-a8af-3c9d8c9cc169} [info] Job systembackup started at 2020-04-04 13:09:54 GMT
2020-04-04 13:09:55 UTC {7b620380-0eff-4d26-93ea-9e24f69f9769} [info] Preparing to backup
2020-04-04 13:09:57 UTC {4a9d0a89-3b93-465d-bf65-64c8189eb80c} [processing] Creating volume snapshot
2020-04-04 13:09:58 UTC {4a9d0a89-3b93-465d-bf65-64c8189eb80c} [info] 
2020-04-04 13:10:05 UTC {4dd61342-a6b6-4c7c-8202-f224e9f2acb9} [info] Starting full backup to [52.80.140.70][Scott]Cloud repository 1
2020-04-04 13:10:05 UTC {df43426b-3ab0-4ad8-b6b7-a521c8a0f3c8} [info] File system indexing is disabled
2020-04-04 13:10:05 UTC {87761826-05e9-47cf-96c3-1dc275e8e588} [processing] Backing up BIOS bootloader on /dev/xvda
2020-04-04 13:10:06 UTC {87761826-05e9-47cf-96c3-1dc275e8e588} [info] 
2020-04-04 13:10:07 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda
2020-04-04 13:10:08 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1 MB at 1.9 MB/s (0%)
2020-04-04 13:10:09 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 89 MB at 53.3 MB/s (4%)
2020-04-04 13:10:10 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 166 MB at 48.5 MB/s (9%)
2020-04-04 13:10:12 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 229 MB at 46.6 MB/s (12%)
2020-04-04 13:10:14 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 330 MB at 45.2 MB/s (18%)
2020-04-04 13:10:17 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 432 MB at 44.1 MB/s (23%)
2020-04-04 13:10:19 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 535 MB at 44.1 MB/s (29%)
2020-04-04 13:10:20 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 554 MB at 44.1 MB/s (30%)
2020-04-04 13:10:22 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 649 MB at 43.8 MB/s (35%)
2020-04-04 13:10:24 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 750 MB at 43.6 MB/s (40%)
2020-04-04 13:10:27 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 853 MB at 43.5 MB/s (46%)
2020-04-04 13:10:29 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 955 MB at 43.3 MB/s (52%)
2020-04-04 13:10:31 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1 GB at 43.2 MB/s (57%)
2020-04-04 13:10:33 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.1 GB at 43.2 MB/s (61%)
2020-04-04 13:10:35 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.2 GB at 43.1 MB/s (66%)
2020-04-04 13:10:38 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.3 GB at 43 MB/s (72%)
2020-04-04 13:10:40 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.4 GB at 43 MB/s (77%)
2020-04-04 13:10:42 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.5 GB at 42.9 MB/s (82%)
2020-04-04 13:10:45 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.6 GB at 42.9 MB/s (88%)
2020-04-04 13:10:45 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.6 GB at 42.9 MB/s (89%)
2020-04-04 13:10:46 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.6 GB at 42.9 MB/s (90%)
2020-04-04 13:10:46 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.6 GB at 42.9 MB/s (91%)
2020-04-04 13:10:47 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.7 GB at 42.9 MB/s (92%)
2020-04-04 13:10:47 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.7 GB at 42.9 MB/s (94%)
2020-04-04 13:10:50 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [processing] Backing up xvda 1.8 GB at 42.8 MB/s (100%)
2020-04-04 13:10:50 UTC {c20b9dcf-91de-4878-8c57-5ec1b83d08f8} [info] Backed up xvda 1.8 GB at 42.2 MB/s
2020-04-04 13:10:51 UTC {abee25d8-09dc-4021-9101-53f65a410b90} [processing] Backing up summary.xml
2020-04-04 13:10:52 UTC {abee25d8-09dc-4021-9101-53f65a410b90} [info] 
2020-04-04 13:10:55 UTC {e2712151-8e36-498d-9c64-eeef132017ff} [processing] Releasing snapshot
2020-04-04 13:10:56 UTC {e2712151-8e36-498d-9c64-eeef132017ff} [info] 
2020-04-04 13:10:57 UTC {de982ec0-261c-4b1b-a7b0-e85aa76b0b39} [info] Processing finished at 2020-04-04 13:10:57 GMT

12. 从 backup 中细粒度的还原数据

# 查看已经备份到云存储库的作业
[root@ip-172-31-18-8 ec2-user]# veeamconfig backup list
Job name                                                 Backup ID                               Repository                               Created at        
ip-172-31-18-8.cn-north-1.compute.internal systembackup  {9d542922-ec52-4ea8-a5f6-58aec041836f}  [52.80.140.70][Scott]Cloud repository 1  2020-04-04 13:09  

# 查看备份作业的内容
[root@ip-172-31-18-8 ec2-user]# veeamconfig backup show --id 9d542922-ec52-4ea8-a5f6-58aec041836f
      Machine name: ip-172-31-18-8.cn-north-1.compute.internal systembackup
         Name:       [xvda2]
         Device:     [/dev/xvda2]
         FS UUID:    [88fd4d41-c180-4721-80c6-535249a4a2bb]
         Offset:     [2097152] bytes (4096 sectors)
         Size:       [10735304192] bytes (20967391 sectors)

# 在本机建立一个 Mount 点
[root@ip-172-31-18-8 ec2-user]# mkdir /mnt/backup

# 将备份集Mount到本地
[root@ip-172-31-18-8 ec2-user]# veeamconfig backup mount --id 9d542922-ec52-4ea8-a5f6-58aec041836f --mountdir /mnt/backup
Backup has been mounted.
Session ID: [{72ff3a97-7471-4629-8604-514609d80e2d}].
Logs stored in: [/var/log/veeam/Mount/Session_20200408_071131_{72ff3a97-7471-4629-8604-514609d80e2d}].

# 按需使用备份数据
[root@ip-172-31-18-8 ec2-user]# ls /mnt/backup
bin  boot  data  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

# 使用需要完成关闭 Mount Session, 先使用Session list 查看

[root@ip-172-31-18-8 ec2-user]#  veeamconfig session list
Job name      Type    ID                                      State    Started at        Finished at       
systembackup  Backup  {5f4b9a94-5eff-44eb-a348-a2b1bfa1a8ca}  Success  2020-04-04 13:09  2020-04-04 13:10  
systembackup  Backup  {e8aa0c75-3358-4cc2-9d41-65aed86b1be4}  Success  2020-04-05 23:00  2020-04-05 23:00  
systembackup  Backup  {44ab2736-4681-4281-b11c-4521ad11124d}  Success  2020-04-06 23:00  2020-04-06 23:00  
Mount         Mount   {72ff3a97-7471-4629-8604-514609d80e2d}  Running  2020-04-08 07:11                    
systembackup  Backup  {4d4c15e6-bbf5-4431-a6ec-6060d88e48b1}  Failed   2020-04-09 05:22  2020-04-09 05:22 

# 关闭那个 Running 的 Mount Session
[root@ip-172-31-18-8 ec2-user]# veeamconfig session stop --id 72ff3a97-7471-4629-8604-514609d80e2d
Session has stopped.
[root@ip-172-31-18-8 ec2-user]#  veeamconfig session list
Job name      Type    ID                                      State    Started at        Finished at       
systembackup  Backup  {5f4b9a94-5eff-44eb-a348-a2b1bfa1a8ca}  Success  2020-04-04 13:09  2020-04-04 13:10  
systembackup  Backup  {e8aa0c75-3358-4cc2-9d41-65aed86b1be4}  Success  2020-04-05 23:00  2020-04-05 23:00  
systembackup  Backup  {44ab2736-4681-4281-b11c-4521ad11124d}  Success  2020-04-06 23:00  2020-04-06 23:00  
Mount         Mount   {72ff3a97-7471-4629-8604-514609d80e2d}  Success  2020-04-08 07:11  2020-04-09 05:31  
systembackup  Backup  {4d4c15e6-bbf5-4431-a6ec-6060d88e48b1}  Failed   2020-04-09 05:22  2020-04-09 05:22  
Total amount: 5

13. 查看还原点,并还原数据


#查看备份任务
[root@ip-172-31-18-8 ec2-user]# veeamconfig backup list
Job name                                                 Backup ID                               Repository                               Created at        
ip-172-31-18-8.cn-north-1.compute.internal systembackup  {9d542922-ec52-4ea8-a5f6-58aec041836f}  [52.80.140.70][Scott]Cloud repository 1  2020-04-04 13:09  
[root@ip-172-31-18-8 ec2-user]# veeamconfig backup show 9d542922-ec52-4ea8-a5f6-58aec041836f
Unknown argument: [9d542922-ec52-4ea8-a5f6-58aec041836f].
#查看备份内容
[root@ip-172-31-18-8 ec2-user]# veeamconfig backup show --id 9d542922-ec52-4ea8-a5f6-58aec041836f
      Machine name: ip-172-31-18-8.cn-north-1.compute.internal systembackup
         Name:       [xvda2]
         Device:     [/dev/xvda2]
         FS UUID:    [88fd4d41-c180-4721-80c6-535249a4a2bb]
         Offset:     [2097152] bytes (4096 sectors)
         Size:       [10735304192] bytes (20967391 sectors)

#查看还原点
[root@ip-172-31-18-8 ec2-user]# veeamconfig point list --backupid 9d542922-ec52-4ea8-a5f6-58aec041836f
Job name                                                 OIB ID                                  Type       Created at        Is corrupt  
ip-172-31-18-8.cn-north-1.compute.internal systembackup  {00a6fee5-62a5-447e-a2ff-9c94ce362fd9}  Full       2020-04-04 13:10  false       
ip-172-31-18-8.cn-north-1.compute.internal systembackup  {e066aabd-15f5-4d07-b66b-72abbcdf2f08}  Increment  2020-04-05 23:00  false       
ip-172-31-18-8.cn-north-1.compute.internal systembackup  {dad4395f-3618-41a0-ad45-467a97a40b00}  Increment  2020-04-06 23:00  false       
ip-172-31-18-8.cn-north-1.compute.internal systembackup  {44e840f7-01d3-4373-b22d-3cac234c6e8f}  Full       2020-04-09 05:36  false

# mount 还原点       
[root@ip-172-31-18-8 ec2-user]# veeamconfig point mount --id 44e840f7-01d3-4373-b22d-3cac234c6e8f --mountdir /mnt/backup
Restore point is mounted.
Session ID: [{fae1ce5b-8df6-4f99-b544-c4502e0e1f4f}].
Logs stored in: [/var/log/veeam/Mount/Session_20200409_055200_{fae1ce5b-8df6-4f99-b544-c4502e0e1f4f}].

# 按需要使用备份数据
[root@ip-172-31-18-8 ec2-user]# ls /mnt/backup
bin  boot  data  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

标签: none

添加新评论