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

MongoDB データベースのバックアップの設定

Kubernetes Operator が MongoDB カスタム リソースを使用して管理する MongoDB データベースの継続的な自動バックアップを構成できます。

注意

MongoDB データベース リソースの配置中に MongoDB リソースのバックアップをすでに構成している場合は、次の手順を完了する必要はありません。

MongoDB リソースのバックアップを構成する前に、次の考慮事項を参照してください。

  • Kubernetes Operator を使用して割り当てラベルを設定すると、割り当てラベルのKubernetes構成ファイルで設定した値が、 MongoDB Ops Manager UI で定義された値を上書きします。 Kubernetes Operator を使用して設定しない割り当てラベルは、 MongoDB Ops Manager UI で設定された値を引き続き使用します。

  • If you set a snapshot schedule field using the Kubernetes Operator, the value that you set in the Kubernetes configuration file for that field overrides the value defined in the Ops Manager UI. Snapshot schedule fields that you don't set using the Kubernetes Operator continue to use the value set in the Ops Manager UI.

    例

    • Kubernetes 演算子 でbackup.snapshotSchedule.snapshotIntervalHours=6を設定します。

    • UI で次の値を設定します。

      • Snapshot Inverval: 10

      • スナップショット保持日数: 5

    Ops Manager uses the following values for your deployment:

    • Snapshot Inverval: 6

    • スナップショット保持日数: 5

  • If you enable backups for your MongoDB database deployment using the Kubernetes Operator, but you don't set a snapshot schedule using the Kubernetes Operator, Ops Manager uses the snapshot schedule you set in the Ops Manager UI.

  • MongoDB配置のバックアップを有効にしているが、スナップショット スケジュールをまったく設定していない場合、 MongoDB Ops Managerはデフォルトのスナップショット スケジュールを使用します。

MongoDB リソースの継続的なバックアップを構成する前に、次のタスクを完了してください。

1

次のレプリカセットの例に示すように、 spec.backup.mode設定を MongoDB database 配置の構成ファイルに追加し、その値をenabledに設定します。

1---
2apiVersion: mongodb.com/v1
3kind: MongoDB
4metadata:
5 name: <my-replica-set>
6spec:
7 members: 3
8 version: "8.0.0"
9 type: ReplicaSet
10 opsManager:
11 configMapRef:
12 name: <my-project>
13 credentials: <my-credentials>
14 backup:
15 # Sets labels for the Backup Daemon.
16 assignmentLabels: ["test1", "test2"]
17 mode: enabled

構成ファイルの作成または編集の詳細については、「レプリカセットの配置 」または「 シャーディングされたクラスターの配置 」を参照してください。

3

Add one or more spec.backup.assignmentLabels to the specification file for the deployment. Use assignment labels to identify that specific backup stores are associated with particular projects. Setting labels in Kubernetes Operator overrides labels that you set in Ops Manager. To learn more, see considerations.

この手順の前のバージョンの、割り当てラベルを含む仕様ファイルの例を参照してください。

4

次のコマンドを実行して、バックアップのステータスを確認します。

kubectl get mdb <resource-name> -n <metadata.namespace> -o yaml

status.backup.statusnameフィールドはバックアップ状態を示します。 バックアップを正常に構成すると、ステータスにSTARTEDが表示されます。

このページを評価