Red Hat Ansible Automation Platform Operator 备份和恢复指南


Red Hat Ansible Automation Platform 2.3

本指南提供了在 OpenShift Container Platform 上备份和恢复 Red Hat Ansible Automation Platform Operator 安装的步骤和参考信息

Red Hat Customer Content Services

摘要

提供反馈:
如果您对本文档有任何改进建议,或发现错误,请联系技术支持 https://access.redhat.com,使用 Docs组件在 Ansible Automation PlatformJIRA 项目中创建一个问题。

前言

感谢您对 Red Hat Ansible Automation Platform 的关注。Ansible Automation Platform 是一个商业产品,它可以帮助团队通过增加控制、知识、协调基于 Ansible 的环境来更好地管理多阶的复杂部署环境。

使用本指南中的步骤创建备份资源,可用于在失败时恢复 Red Hat Ansible Automation Platform 部署。

第 1 章 Red Hat Ansible Automation Platform 的备份和恢复

为了防止意外的数据丢失和应用程序错误,对 Red Hat Ansible Automation Platform 部署执行定期备份至关重要。除了数据丢失的防止外,备份还允许您回退到不同的部署状态。

1.1. 关于备份和恢复

红帽建议在 Red Hat OpenShift Container Platform 环境中备份 Red Hat Ansible Automation Platform 部署,以防止数据丢失。

Red Hat Ansible Automation Platform 部署的备份资源包括:

  • 在 {PlatormNameShort} 自定义资源对象的 spec 部分中自定义特定值部署
  • 备份 postgresql 数据库
  • secret_key, admin_password, 和 broadcast_websocket secrets
  • 数据库配置
注意

确保备份资源的安全,因为它们可以包含敏感信息。

1.1.1. 备份建议

恢复数据丢失需要您定期计划并创建 Red Hat Ansible Automation Platform 部署的备份资源。红帽建议在以下情况下备份 Red Hat Ansible Automation Platform 部署:

  • 在升级 Red Hat Ansible Automation Platform 部署前
  • 在升级 Openshift 集群前
  • 每周一次。如果您的环境被配置为自动升级,这尤其重要。

第 2 章 创建 Red Hat Ansible Automation Platform 备份资源

备份 Red Hat Ansible Automation Platform 部署涉及为部署的自动化中心和自动化控制器实例创建备份资源。使用以下步骤为 Red Hat Ansible Automation Platform 部署创建备份资源。

2.1. 备份 Automation 控制器部署

使用这个流程备份控制器的部署,包括作业、清单和凭证。

先决条件

  • 您必须使用 Openshift 集群进行身份验证。
  • Ansible Automation Platform Operator 已安装到集群中。
  • 自动化控制器使用 Ansible Automation Platform Operator 部署到。

流程

  1. 登录到 Red Hat OpenShift Container Platform
  2. 进入到 OperatorsInstalled Operators
  3. 选择项目命名空间中安装的 Ansible Automation Platform Operator。
  4. 选择 Automation Controller Backup 选项卡。
  5. Create AutomationControllerBackup
  6. 输入备份的名称
  7. 输入正在备份的部署的 Ansible Automation Platform 实例的 Deployment 名称。例如,如果您的自动化控制器必须备份,且部署名称为 aap-controller,在 Deployment name 字段中输入 'aap-controller'。
  8. 如果要使用自定义、预先创建的 pvc:

    1. (可选)输入备份持久性卷声明的名称
    2. (可选)输入 Backup PVC 存储要求,以及 Backup PVC 存储类

      注意

      如果没有提供 pvc 或存储类,集群的默认存储类将用于创建 pvc。

    3. 如果您有大型数据库,根据备份管理 pod 资源要求中的内容指定您的存储请求。

      注意

      您可以在 postgres pod 中运行以下命令来检查现有 postgres 数据库数据目录的大小。

      $ df -h | grep "/var/lib/pgsql/data"
  9. Create

    创建指定部署的备份 tarball,并可用于数据恢复或部署回滚。将来的备份存储在同一 pvc 上的单独 tar 文件中。

验证

  1. 登录到 Red Hat OpenShift Container Platform
  2. 进入到 OperatorsInstalled Operators
  3. 选择项目命名空间中安装的 Ansible Automation Platform Operator。
  4. 选择 AutomationControllerBackup 选项卡。
  5. 选择您要验证的备份资源。
  6. 滚动到 Conditions,并检查 Successful 状态为 True

    注意

    如果 SuccessfulFalse,备份会失败。检查自动化控制器 Operator 日志中的错误以修复问题。

2.2. 备份 Automation hub 部署

使用这个流程备份 hub 的部署,包括所有托管的 Ansible 内容。

先决条件

  • 您必须使用 Openshift 集群进行身份验证。
  • Ansible Automation Platform Operator 已安装到集群中。
  • Automation hub 使用 Ansible Automation Platform Operator 部署到。

流程

  1. 登录到 Red Hat OpenShift Container Platform
  2. 进入到 OperatorsInstalled Operators
  3. 选择项目命名空间中安装的 Ansible Automation Platform Operator。
  4. 选择 Automation Hub Backup 选项卡。
  5. Create AutomationHubBackup
  6. 输入备份的名称
  7. 输入正在备份的部署的 Ansible Automation Platform 实例的 Deployment 名称。例如,如果您的自动化中心必须备份,且部署名称为 aap-hub,在 Deployment name 字段中输入 'aap-hub'。
  8. 如果要使用自定义、预先创建的 pvc:

    1. (可选)输入备份持久性卷声明, 备份持久性卷命名空间, 备份 PVC 存储要求, 和 备份 PVC 存储类的名称。
  9. Create

    创建指定部署的备份,并可用于数据恢复或部署回滚。

第 3 章 恢复 Red Hat Ansible Automation Platform 部署

如果丢失了系统或升级问题的信息,您可以使用部署实例的备份资源。使用以下步骤恢复自动化控制器和自动化中心部署文件。

3.1. 恢复自动化控制器部署

使用这个流程从 AutomationControllerBackup 恢复以前的控制器部署。您提供的部署名称将是要创建的新 AutomationController 自定义资源的名称。

注意

为新 AutomationController 自定义资源指定的名称必须与现有部署不匹配,否则恢复过程将失败。如果指定的名称与现有部署匹配,请参阅故障排除来解决这个问题。

先决条件

  • 您必须使用 Openshift 集群进行身份验证。
  • 自动化控制器已部署到集群中。
  • 集群中的 PVC 上提供了 AutomationControllerBackup。

流程

  1. 登录到 Red Hat OpenShift Container Platform
  2. 进入到 OperatorsInstalled Operators
  3. 选择项目命名空间中安装的 Ansible Automation Platform Operator。
  4. 选择 Automation Controller Restore 选项卡。
  5. Create AutomationControllerRestore
  6. 输入恢复部署的名称
  7. 为恢复的部署输入新部署名称

    注意

    这应该与原始部署名称不同。

  8. 选择要从中恢复的 Backup 源。建议的备份 CR
  9. 输入 AutomationControllerBackup 对象的备份名称
  10. Create

    创建了一个新部署,并将备份恢复到其中。这可能需要大约 5 到 15 分钟,具体取决于您的数据库的大小。

验证

  1. 登录到 Red Hat OpenShift Container Platform
  2. 进入到 OperatorsInstalled Operators
  3. 选择项目命名空间中安装的 Ansible Automation Platform Operator。
  4. 选择 AutomationControllerRestore 选项卡。
  5. 选择您要验证的恢复资源。
  6. 滚动到 Conditions,并检查 Successful 状态为 True

    注意

    如果 SuccessfulFalse,则恢复会失败。检查自动化控制器 Operator 日志中的错误以修复问题。

3.2. 恢复 Automation hub 部署

使用这个流程将以前的 hub 部署恢复到命名空间中。您提供的部署名称将是要创建的新 AutomationHub 自定义资源的名称。

注意

为新 AutomationHub 自定义资源指定的名称必须与现有部署不匹配,否则恢复过程将失败。

先决条件

  • 您必须使用 Openshift 集群进行身份验证。
  • Automation hub 已部署到集群中。
  • 集群中的 PVC 上提供了 AutomationHubBackup。

流程

  1. 登录到 Red Hat OpenShift Container Platform
  2. 进入到 OperatorsInstalled Operators
  3. 选择项目命名空间中安装的 Ansible Automation Platform Operator。
  4. 选择 Automation Hub Restore 选项卡。
  5. Create AutomationHubRestore
  6. 输入恢复部署的名称
  7. 选择要从中恢复的 Backup 源。建议的备份 CR
  8. 输入 AutomationHubBackup 对象的备份名称
  9. Create

    创建了一个新部署,并将备份恢复到其中。

第 4 章 故障排除

使用这些信息诊断和解决备份和恢复过程中的问题。

4.1. 自动化控制器自定义资源的名称与现有部署相同

为新 AutomationController 自定义资源指定的名称必须与现有部署不匹配,否则恢复过程将失败。

如果您的 AutomationController 客户资源与现有部署匹配,请执行以下步骤来解决这个问题。

流程

  1. 删除现有的 AutomationController 和关联的 postgres PVC:

    oc delete automationcontroller <YOUR_DEPLOYMENT_NAME> -n <YOUR_NAMESPACE>
    
    oc delete pvc postgres-13-<YOUR_DEPLOYMENT_NAME>-13-0 -n <YOUR_NAMESPACE>
  2. 使用带有相同 deployment_name 的 AutomationControllerRestore :

    oc apply -f restore.yaml

法律通告

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.