如果运行 MongoDB Ops Manager 应用程序实例或应用程序数据库节点的 Kubernetes 集群发生故障,但中央集群可用,您可以使用 Kubernetes Operator 根据以下场景重新配置应用程序数据库的副本集和 MongoDB Ops Manager 应用程序实例的部署:
如果部分或全部MongoDB Ops Manager应用程序实例发生故障,也不会丢失任何数据,因为MongoDB Ops Manager应用程序是无状态的。 要提高MongoDB Ops Manager应用程序的可用性,请将新的MongoDB Ops Manager应用程序实例添加到已配置且可用Kubernetes成员集群中,或者添加新的Kubernetes集群来运行MongoDB Ops Manager应用程序实例。
如果只有少数副本集节点发生故障,并且副本集集中的大多数节点可用,则在协调进程, Kubernetes Operator 会忽略发生故障的Kubernetes集群,并且应用程序数据库将保持在可写入状态。
使用
spec.applicationDatabase.clusterSpecList设置将应用程序数据库的副本集节点添加到已配置且可用的成员Kubernetes集群,或者添加在其上部署应用程序数据库的故障副本集成员的新Kubernetes集群。 您还可以在出现故障的Kubernetes集群上扩展副本集的节点,以重新配置副本集,使其不再包含这些节点。If a majority of replica set's nodes fail, the replica set can't form a voting majority to elect a primary node. To learn more, see Replica Set Deployment Architectures. In this case, if at least one node in an Application Database's replica set remains available, then no data is lost. Because there is no primary node in a replica set, you must forcibly reconfigure the replica set to add new replica set nodes. The nodes will form a voting majority allowing the replica set to elect a primary. New Application Database instances will sync with the healthy nodes to receive the data.
If all Kubernetes member clusters hosting the Application Database's replica set nodes fail, this causes an irreversible data loss (Ops Manager doesn't back up the Application Database). If possible, use an odd number of member Kubernetes clusters and distribute your Application Database nodes across data centers, zones, or Kubernetes clusters. To learn more, see Replica Sets Distributed Across Two or More Data Centers.