备份和恢复 NetQ

以下各节介绍如何备份和恢复本地部署的 NetQ 数据和 VM。云部署会自动备份。

您必须使用 sudo 权限运行备份和恢复脚本。

备份您的 NetQ 数据

  1. 检索 vm-backuprestore.sh 脚本

a. 在 NVIDIA 应用中心,登录到您的帐户。

b. 选择 NVIDIA 许可门户

c. 从菜单中选择软件下载

d. 点击产品系列并选择 NetQ

e. 找到最新的NetQ 升级备份恢复文件,然后选择下载

f. 如果出现提示,请阅读许可协议并继续下载。

  1. vm-backuprestore.sh 脚本复制到您的 NetQ 服务器
username@hostname:~$ scp ./vm-backuprestore.sh cumulus@10.10.10.10:/home/cumulus/
cumulus@10.10.10.10's password:
vm-backuprestore.sh                                                                                       100%   15KB  54.0KB/s   00:00 
  1. 登录到您的 NetQ 服务器并将脚本设置为可执行
cumulus@netq-appliance:/home/cumulus# chmod +x /usr/sbin/vm-backuprestore.sh
  1. 在您复制 vm-backuprestore.sh 脚本的目录中,运行
cumulus@netq-appliance:~$ sudo ./vm-backuprestore.sh --backup
[sudo] password for cumulus:
Mon Feb  6 12:37:18 2024 - Please find detailed logs at: /var/log/vm-backuprestore.log
Mon Feb  6 12:37:18 2024 - Starting backup of data, the backup might take time based on the size of the data
Mon Feb  6 12:37:19 2024 - Scaling static pods to replica 0
Mon Feb  6 12:37:19 2024 - Scaling all pods to replica 0
Mon Feb  6 12:37:28 2024 - Scaling all daemonsets to replica 0
Mon Feb  6 12:37:29 2024 - Waiting for all pods to go down
Mon Feb  6 12:37:29 2024 - All pods are down
Mon Feb  6 12:37:29 2024 - Creating backup tar /opt/backuprestore/backup-netq-standalone-onprem-4.9.0-2024-02-06_12_37_29_UTC.tar
Backup is successful, please scp it to the master node the below command:
      sudo scp /opt/backuprestore/backup-netq-standalone-onprem-4.9.0-2024-02-06_12_37_29_UTC.tar cumulus@<ip_addr>:/home/cumulus
 
  Restore the backup file using the below command:
      ./vm-backuprestore.sh --restore --backupfile /opt/backuprestore/backup-netq-standalone-onprem-4.9.0-2024-02-06_12_37_29_UTC.tar
cumulus@netq-appliance:~$
  1. 验证备份文件是否成功创建

    cumulus@netq-appliance:~$ cd /opt/backuprestore/
    cumulus@netq-appliance:~/opt/backuprestore$ ls
    backup-netq-standalone-onprem-4.9.0-2024-02-06_12_37_29_UTC.tar
    

恢复您的 NetQ 数据

使用您在上述步骤中创建的备份文件恢复 NetQ 数据。备份脚本的恢复选项将数据从备份文件复制到数据库,对其进行解压缩,验证恢复,并启动所有必要的服务。您不应看到因恢复操作而导致任何数据丢失。

运行恢复脚本,引用备份文件所在的目录。

如果您将 NetQ 数据恢复到 IP 地址与用于备份数据的服务器不同的服务器,则必须重新配置每个交换机上的代理作为最后一步。

cumulus@netq-appliance:~$ sudo vm-backuprestore.sh --restore --backupfile /home/cumulus/backup-netq-standalone-onprem-4.10.0-2029-02-06_12_37_29_UTC.tar
Mon Feb  6 12:39:57 2024 - Please find detailed logs at: /var/log/vm-backuprestore.log
Mon Feb  6 12:39:57 2024 - Starting restore of data
Mon Feb  6 12:39:57 2024 - Extracting release file from backup tar
Mon Feb  6 12:39:57 2024 - Cleaning the system
Mon Feb  6 12:39:57 2024 - Restoring data from tarball /home/cumulus/backup-netq-standalone-onprem-4.10.0-2024-02-06_12_37_29_UTC.tar
Data restored successfully
  Please follow the below instructions to bootstrap the cluster
  The config key restored is EhVuZXRxLWVuZHBvaW50LWdhdGVfYXkYsagDIix2OUJhMUpyekMwSHBBaitUdTVDaTRvbVJDR3F6Qlo4VHhZRytjUUhLZGJRPQ==, alternately the config key is available in file /tmp/config-key
 
  Pass the config key while bootstrapping:
  Example(standalone): netq install standalone full interface eth0 bundle /mnt/installables/NetQ-4.12.0.tgz config-key EhVuZXRxLWVuZHBvaW50LWdhdGV3YXkYsagDIix2OUJhMUpyekMwSHBbaitUdTVDaTRvbVJDR3F6Qlo4VHhZRytjUUhLZGJRPQ==
  Example(cluster):    netq install cluster full interface eth0 bundle /mnt/installables/NetQ-4.12.0.tgz config-key EhVuZXRxLWVuZHBvaW50LWdhdGV3YXkYsagDIix2OUJhMUpyekMwSHBbaitUdTVDaTRvbVJDR3F6Qlo4VHhZRytjUUhLZGJRPQ==
  Alternately you can setup config-key post bootstrap in case you missed to pass it during bootstrap
  Example(standalone): netq install standalone activate-job config-key EhVuZXRxLWVuZHBvaW50LWdhdGV3YXkYsagDIix2OUJhMUpyekMwSHBbaitUdTVDaTRvbVJDR3F6Qlo4VHhZRytjUUhLZGJRPQ==
  Example(cluster):    netq install cluster activate-job config-key EhVuZXRxLWVuZHBvaW50LWdhdGV3YXkYsagDIix2OUJhMUpyekMwSHBbaitUdTVDaTRvbVJDR3F6Qlo4VHhZRytjUUhLZGJRPQ==
  In case the IP of the restore machine is different from the backup machine, please reconfigure the agents using: https://docs.nvda.net.cn/networking-ethernet-software/cumulus-netq/Installation-Management/Install-NetQ/Install-NetQ-Agents/#configure-netq-agents-using-a-configuration-file
cumulus@netq-appliance:~$