AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。

Flex クラスターを専用クラスターに移行

Atlas Kubernetes Operator は、Flex クラスターから専用クラスターへのインプレース移行をサポートしています。これにより、 Kubernetes環境からデータベースインフラストラクチャを直接増やすできます。

始める前に、以下のものを用意してください。

  • Atlas Kubernetes Operator によって管理される既存の Flex クラスター階層 AtlasDeployment。

  • Kubernetesクラスター内の Flex クラスター階層の AtlasDeploymentリソースを変更するための権限。

  • Atlasプロジェクトで有効になっている請求。アップグレードすると、Atlas アカウントに料金が発生します。

1

Flex クラスター構成は、Atlas Kubernetes Operator によって管理される AtlasDeploymentリソースで確認できます。

次の例は、us-east-1 リージョンのAmazon Web Servicesの Flex クラスター構成を示しています。

# my-cluster.yamlapiVersion: atlas.mongodb.com/v1kind: AtlasDeploymentmetadata: name: my-flex-clusterspec: projectRef: name: my-atlas-project flexSpec: name: my-cluster providerSettings: backingProviderName: AWS regionName: US_EAST_1
2

spec.upgradeToDedicatedフィールドを AtlasDeploymentリソースに追加します。このフィールドはブール値のフラグで、true に設定すると、Flex クラスターから専用クラスターへのインプレース アップグレードが開始されます。

spec.deploymentSpec ブロックで、ターゲット専用クラスターの完全な構成を指定します。これには、プロバイダー、リージョン、インスタンスサイズ、その他の必要なパラメーターなどの詳細が含まれます。

専用クラスターには、元の Flex クラスターと同じ名前を使用します。

注意

専用クラスターに別の名前を使用すると、移行は失敗します。

次の例は、Flex クラスター構成を変更して専用クラスターへの移行を開始する方法を示しています。

# my-cluster.yamlapiVersion: atlas.mongodb.com/v1kind: AtlasDeploymentmetadata: # The name MUST remain the same name: my-flex-clusterspec: projectRef: name: my-atlas-project # Add the upgrade flag upgradeToDedicated: true # Add the full configuration for the target Dedicated-cluster deploymentSpec: name: "my-cluster" # The name MUST remain the same clusterType: REPLICASET backupEnabled: true replicationSpecs: - regionConfigs: - providerName: AWS regionName: US_EAST_1 priority: 7 electableSpecs: instanceSize: M10 nodeCount: 3
3

kubectl apply コマンドを使用して、 Kubernetesクラスターへの変更を適用します。

kubectl apply -f my-cluster.yaml
4

Atlas Kubernetes Operator は、移行プロセスをすぐに開始します。kubectl describe コマンドを使用して進捗状況を監視できます。

kubectl describe atlasdeployment my-flex-cluster

最初に、DeploymentReady 条件は次のように表示されます。

Status: Conditions: ... - Last Transition Time: 2025-06-18T10:00:00Z Message: Cluster upgrade to dedicated instance initiated in Atlas... Reason: FlexToDedicatedMigrationProgressing Status: "False" Type: DeploymentReady

移行が完了すると、DeploymentReady の条件は次のように更新されます。

Status: Conditions: ... - Last Transition Time: 2025-06-18T10:15:00Z Message: Cluster upgrade successful. You can now remove the 'upgradeToDedicated' flag from the spec. Status: "True" Type: DeploymentReady

アップグレード完了後の 出力にも Normalイベントが表示されます。移行が失敗した場合、DeploymentReady 条件にはエラー メッセージと Reason が表示されます。すでにクラスターを専用クラスターに移行している場合は、変更はありません。

5

移行が完了したら、AtlasDeploymentリソースから upgradeToDedicated フラグを削除し、再度適用できます。この手順は任意ですが、構成をクリーンに維持し、移行が誤って再トリガーされるのを防ぐために推奨されます。

最後の AtlasDeploymentリソースは、次の例のようになります。

# my-cluster.yamlapiVersion: atlas.mongodb.com/v1kind: AtlasDeploymentmetadata: name: my-flex-clusterspec: projectRef: name: my-atlas-project deploymentSpec: name: "my-cluster" # The name MUST remain the same clusterType: REPLICASET backupEnabled: true replicationSpecs: - regionConfigs: - providerName: AWS regionName: US_EAST_1 priority: 7 electableSpecs: instanceSize: M10 nodeCount: 3
6

Flex クラスターが専用クラスターに正常に移行されました。クラスターは 専用クラスター M10インスタンスになりました。Atlas Kubernetes Operator を使用して、それを専用クラスターとして管理します。アプリケーション接続文字列が新しい専用クラスターを点ました。

このページを評価

項目一覧