マルチ Kubernetes クラスターの MongoDB 配置をトラブルシューティングするには、このセクションの手順に従います。
Kubernetes クラスターの障害からの回復
This procedure uses the same cluster names as in the Prerequisites. If the cluster MDB_CLUSTER_1
that holds MongoDB nodes goes down, and if you provision a new cluster named MDB_CLUSTER_4
instead of MDB_CLUSTER_1
to hold the new MongoDB nodes, run the MongoDB kubectl plugin with the updated list of member clusters, and then edit the MongoDBMultiCluster
resource spec on the operator cluster.
クラスター障害後に複数の Kubernetes クラスターの MongoDB 配置を再構成するには、次のように、失敗した Kubernetes クラスターを新しくプロビジョニングされたクラスターに置き換えます。
recover
パラメーターと-member-clusters
オプションで指定された新しいクラスターMDB_CLUSTER_4
を使用してMongoDB kubernetes プラグインを実行します。 これにより、Kubernetes Operator は新しいクラスターと通信して、そのクラスター上の MongoDB ノードをスケジュールできます。 次の例では、-member-clusters
に${MDB_CLUSTER_4_FULL_NAME}
が含まれています。kubectl mongodb multicluster recover \ --central-cluster="MDB_CENTRAL_CLUSTER_FULL_NAME" \ --member-clusters="${MDB_CLUSTER_2_FULL_NAME},${MDB_CLUSTER_3_FULL_NAME},${MDB_CLUSTER_4_FULL_NAME}" \ --member-cluster-namespace="mongodb" \ --central-cluster-namespace="mongodb" \ --operator-name=mongodb-enterprise-operator-multi-cluster \ --source-cluster="${MDB_CLUSTER_2_FULL_NAME}" 演算子クラスターで、
MongoDBMultiCluster
リソース仕様を検索して編集して、新しいクラスター名をclusterSpecList
に追加し、失敗したKubernetesクラスターをこのリストから削除します。クラスター名の結果のリストは、次の例のようになります。clusterSpecList: - clusterName: ${MDB_CLUSTER_4_FULL_NAME} members: 3 - clusterName: ${MDB_CLUSTER_2_FULL_NAME} members: 2 - clusterName: ${MDB_CLUSTER_3_FULL_NAME} members: 3 Kubernetes Operator ポッドを再起動します。 再起動後、Kubernetes Operator は、
MDB_CLUSTER_1
障害の代替として作成した新しく作成したMDB_CLUSTER_4
クラスター上の MongoDB 配置を調整します。 リソース調整の詳細については、「配置アーキテクチャと図 」を参照してください。
また、「 ConfigMap 名 mongodb-enterprise-operator-member-list はハードコードされている 」も参照してください。