对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

备份Ops Manager 应用程序数据库

应用程序数据库存储Ops Manager设置、操作历史记录和备份元数据。当您将应用程序数据库部署为外部应用程序数据库时, Kubernetes Operator 会将其作为标准MongoDB自定义资源进行管理,这意味着Ops Manager可以像Kubernetes Operator 管理的任何其他MongoDB 部署一样对其进行备份和恢复。

要部署外部应用程序数据库,请参阅以下过程:

具有内部托管的应用程序数据库的Ops Manager部署将应用程序数据库存储在Ops Manager自定义资源中,这是标准备份工具无法访问的。如果Ops Manager本身出现故障,您可能会失去对其管理的部署的控制。

备份外部应用程序数据库可满足以下需求:

  • 灾难恢复。在数据丢失、数据损坏或配置更改失败后恢复应用程序数据库。

  • 运营安全网。将错误的批量写入回滚到其发生之前的那一刻。

  • 降低恢复目标。与仅基于定期快照的策略相比,连续oplog捕获支持更低的恢复点和恢复时间目标。

Ops Manager保留应用程序数据库数据的副本和连续的oplog条目流,这使您可以执行以下操作:

  • 将应用程序数据库的完整快照恢复到新的或现有的部署。

  • 通过将oplog重放到您选择的时间戳,将应用程序数据库恢复到快照之间的任何时间点。

  • Query a backup snapshot without restoring it. To learn more, see Configure Queryable Backups for Ops Manager Resources.

  • 满足保留和合合规要求,可以选择使用不可变快照。

外部应用程序数据库部署使用以下资源:

Resource
说明

Management Ops Manager

具有自己的内部托管应用程序数据库的 Ops Manager资源。管理Ops Manager实例不管理您的数据库。它管理包含外部应用程序数据库的项目,并在您丢失Ops Manager主节点 (primary node in the replica set)实例时充当恢复引擎。将其部署在单独的故障域中,例如不同的可用区。

外部应用程序数据库

A MongoDB resource with spec.role set to AppDB. To learn more, see MongoDB Database Resource Specification. Its name must be <primary-om-name>-db. The management Ops Manager instance manages this resource as a project, so you can enable backup on it like any other MongoDB resource.

主 MongoDB Ops Manager

The Ops Manager resource that manages your databases. It omits spec.applicationDatabase and references the external Application Database with spec.externalApplicationDatabaseRef.

Diagram of an external Application Database deployment. The management Ops Manager instance with its own internal Application Database, the external Application Database MongoDB resource, and the primary Ops Manager instance that references the external Application Database.
点击放大

Because a new Ops Manager instance can't start without an Application Database, and a MongoDB resource with spec.role set to AppDB can't reconcile without an available Ops Manager instance, the management Ops Manager instance is a prerequisite for an external Application Database. Deploy it before you deploy the external Application Database.

如果丢失了主节点 (primary node in the replica set)Ops Manager实例,则可以使用管理Ops Manager实例恢复外部应用程序数据库,然后根据恢复的应用程序数据库重新创建主节点 (primary node in the replica set)Ops Manager实例,然后恢复MongoDB工作负载。

Ops Manager stores backup metadata in the Application Database, and both the Ops Manager Application and the Backup Daemon connect to the Application Database. When you reference an external Application Database with spec.externalApplicationDatabaseRef, the Kubernetes Operator handles this connection for you:

  • The Kubernetes Operator resolves the TLS configuration and CA of the referenced MongoDB resource and applies it to both the Ops Manager StatefulSet and the Backup Daemon StatefulSet. The Backup Daemon trusts a TLS-enabled external Application Database the same way it trusts an internally managed one.

  • 备份守护程序使用Kubernetes Operator 为Ops Manager 应用程序计算的相同连接字符串进行连接。

Enabling backup doesn't change. You set spec.backup.enabled on the primary Ops Manager resource, as you would for an internally managed Application Database. The only difference is where the Application Database runs.

To back up the external Application Database itself, enable backup on the MongoDB resource that represents it, in the project that the management Ops Manager instance manages. To learn more, see Configure MongoDB Database Backups.

在内部托管的应用程序数据库和外部应用程序数据库之间迁移期间, Kubernetes Operator 在应用程序数据库 StatefulSet 上设置注释,以记录StatefulSet 已准备好更改所有者。 Kubernetes Operator 设置并读取这些注释。请勿自行设立。

注解
说明

mongodb.com/appdb-migration-ready

The Ops Manager resource released the StatefulSet so that the MongoDB resource can take ownership of it. The Kubernetes Operator sets this annotation when you migrate from an internally managed Application Database to an external Application Database. To learn more, see Migrate an Application Database to an External Deployment.

mongodb.com/appdb-reverse-migration-ready

The MongoDB resource released the StatefulSet so that the Ops Manager resource can reclaim it. The Kubernetes Operator sets this annotation when you return an external Application Database to internal management. To learn more, see Return an External Application Database to Ops Manager.

在备份外部应用程序数据库之前,请完成以下任务:

外部应用程序数据库备份具有以下限制:

  • The external Application Database must be a MongoDB resource on a single Kubernetes cluster. The Kubernetes Operator rejects MongoDBMultiCluster resources and MongoDB resources that use a multi-cluster topology. Multi-cluster support is planned for a later release.

  • 此功能不会跨区域或跨Kubernetes集群复制应用程序数据库。

  • 除了应用程序数据库本身之外,此功能不会备份或恢复Ops Manager状态。

  • 此功能不会改变备份或恢复使用Ops Manager管理的MongoDB部署的方式。

  • The Kubernetes Operator doesn't support automationConfig overrides for an external Application Database, because the MongoDB resource has no equivalent setting.

  • The Kubernetes Operator doesn't support spec.applicationDatabase.passwordSecretKeyRef during migration to an external Application Database. The Kubernetes Operator generates a new password and rotates any password that you provided.

  • 当您将现有MongoDB 部署引用为外部应用程序数据库时,您将负责该部署的日常管理。 Kubernetes Operator 未提供任何工具来协调MongoDB资源配置与内部托管的应用程序数据库配置。您必须自己指定该配置。