2.5. 创建 control plane 节点的备份
要创建 control plane 节点的备份,请使用 backup-and-restore Ansible 角色。然后,当节点损坏或无法访问时,您可以使用备份将 control plane 节点恢复到之前的状态。control plane 节点的备份包括在 control plane 节点上运行的数据库备份。
先决条件
- 您已在备份节点上安装和配置了 NFS 或 SFTP 服务器。有关创建新 NFS 服务器的详情请参考 第 2.2 节 “在备份节点上安装并配置 NFS 服务器”。
- 您已在 control plane 节点上安装了 ReaR。更多信息请参阅 第 2.3 节 “在 control plane 节点上安装 ReaR”。
- 如果您的网络接口使用了 OVS 网桥,则已配置了 OVS 接口。更多信息请参阅 第 2.4 节 “为备份配置 Open vSwitch (OVS)接口”。
流程
在每个 control plane 节点上,以
root用户身份备份每个节点的config-drive分区:[root@controller-x ~]$ dd if=<config_drive_partition> of=/mnt/config-drive在 undercloud 节点上,创建以下 Ansible playbook:
(undercloud) [stack@undercloud ~]$ cat <<'EOF' > ~/bar_rear_create_restore_images-controller.yaml # Playbook # Using ReaR on the control plane nodes. - become: true hosts: ceph_mon name: Backup ceph authentication tasks: - name: Backup ceph authentication role include_role: name: backup-and-restore tasks_from: ceph_authentication tags: - bar_create_recover_image - become: true hosts: Controller name: Create the recovery images for the control plane roles: - role: backup-and-restore EOF在 undercloud 节点上,输入以下
ansible-playbook命令来创建 control plane 节点的备份:(undercloud) [stack@undercloud ~]$ ansible-playbook \ -v -i ~/tripleo-inventory.yaml \ --extra="ansible_ssh_common_args='-o StrictHostKeyChecking=no'" \ --become \ --become-user root \ --tags bar_create_recover_image \ ~/bar_rear_create_restore_images-controller.yaml