Kubernetes Operator は、ファイルシステム スナップショットのストレージをサポートします。
前提条件
To configure file system snapshot storage, your Kubernetes Operator deployment must have a storage class configured with the ReadWriteMany method.
手順
ファイルシステムのスナップショット ストレージを構成するには、次の手順に従います。
Peristent VolumeClaim オブジェクトを作成します。
Create a PersistentVolumeClaim object, and allocate storage as needed. Set accessModes to ReadWriteMany:
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: snapshot-store-ops-manager spec: storageClassName: managed-nfs-storage #SC that supports(RWX) accessModes: - ReadWriteMany resources: requests: storage: 10G ...
Persistent VolumeClaim を指定するMongoDB Ops Managerカスタム リソース定義 を作成して適用します。
Create an Ops Manager CustomResourceDefinition that specifies your PersistentVolumeClaim object and the spec.backup.fileSystemStores field, which is the name of your file system snapshot store.
The following example creates a CustomResourceDefinition file named ops-manager-fs.yaml, for the MongoDB oplog store with a kube-user.
apiVersion: mongodb.com/v1 kind: MongoDBOpsManager metadata: name: ops-manager spec: replicas: 1 version: 8.0.0 adminCredentials: ops-manager-admin-secret statefulSet: spec: template: spec: volumes: - name: snapshot-store persistentVolumeClaim: claimName: snapshot-store-ops-manager containers: - name: mongodb-ops-manager volumeMounts: - name: snapshot-store mountPath: /snapshot_store backup: enabled: true fileSystemStores: - name: filesystem1 assignmentLabels: ["test1", "test2"] opLogStores: assignmentLabels: ["test1", "test2"] - name: oplog1 mongodbResourceRef: name: oplog-db # mongodbUserRef: # name: kube-user statefulSet: spec: template: spec: volumes: - name: snapshot-store persistentVolumeClaim: claimName: snapshot-store-ops-manager containers: - name: mongodb-backup-daemon volumeMounts: - name: snapshot-store mountPath: /snapshot_store applicationDatabase: members: 3 version: 8.0.0
oplog ストアを構成します。
MongoDB Ops Managerオブジェクトがその状態を と報告するまで待ってからRunning 、oplog リソース の配置 手順の バックアップ設定の構成 の手順で説明されているように MongoDB Ops Managerストアを構成します。
MongoDB Ops Managerで ファイル システム スナップショット ストアを作成します 。
MongoDB Ops Manager インスタンスにログインし、次のドキュメントに移動します。 Admin Backup Snapshot Store Create New File System Store 。
Set the name to the value you set for backup.fileSystemStores in your CustomResourceDefinition. Set the other values as appropriate, then click Create.
新しいファイルシステム ストアを作成すると、MongoDB Ops Manager オブジェクトはPendingのBACKUP状態を報告します。