对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

使用 Kubernetes Operator 配置文件系统备份存储

Kubernetes 操作符 支持存储文件系统快照。

To configure file system snapshot storage, your Kubernetes Operator deployment must have a storage class configured with the ReadWriteMany method.

要配置文件系统快照存储,请执行以下操作:

1

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
...
2

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
3

对您的 Ops Manager 资源定义的文件名调用以下kubectl命令:

kubectl apply -f <opsmgr-resource>.yaml
4

等待您的 Ops Manager 对象将其状态报告为 ,然后按照“ 部署Running Ops Manager 资源 ”过程的“ 配置备份设置 ”步骤中的描述配置您的 oplog 存储。

5

登录到您的 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.

创建新的文件系统存储后,Ops Manager 对象将报告PendingBACKUP状态。

给本页内容打分

在此页面上