跳转至

回收PVGraph

Nebula Operator使用持久化卷PV(Persistent Volume)和持久化卷声明PVC(Persistent Volume Claim)来存储持久化数据。如果用户不小心删除了一个NebulaGraph集群,PV和PVC对象及其数据仍可保留,以确保数据安全。

用户可以在集群的CR实例的配置文件中通过参数enablePVReclaim定义是否回收PV。

如果用户需要删除图空间并想保留相关数据,可以更新NebulaGraph集群,即设置enablePVReclaimtrue

前提条件Graph

已使用K8s创建一个集群。具体步骤,参见Graph。

操作步骤Graph

以下示例使用名为nebula的集群说明如何设置enablePVReclaim

  1. 执行以下命令进入nebula集群的编辑页面。

    kubectl edit nebulaclusters.apps.nebula-graph.io nebula
    
  2. 在YAML文件的spec配置项中,添加enablePVReclaim并设置其值为true

    apiVersion: apps.nebula-graph.io/v1alpha1
    kind: NebulaCluster
    metadata:
      name: nebula
    spec:
      enablePVReclaim: true  //设置其值为true。
      graphd:
        image: vesoft/nebula-graphd
        logVolumeClaim:
          resources:
            requests:
              storage: 2Gi
          storageClassName: fast-disks
        replicas: 1
        resources:
          limits:
            cpu: "1"
            memory: 1Gi
          requests:
            cpu: 500m
            memory: 500Mi
        version: v2.6.0
      imagePullPolicy: IfNotPresent
      metad:
        dataVolumeClaim:
          resources:
            requests:
              storage: 2Gi
          storageClassName: fast-disks
        image: vesoft/nebula-metad
        logVolumeClaim:
          resources:
            requests:
              storage: 2Gi
          storageClassName: fast-disks
        replicas: 1
        resources:
          limits:
            cpu: "1"
            memory: 1Gi
          requests:
            cpu: 500m
            memory: 500Mi
        version: v2.6.0
      nodeSelector:
        nebula: cloud
      reference:
        name: statefulsets.apps
        version: v1
      schedulerName: default-scheduler
      storaged:
        dataVolumeClaim:
          resources:
            requests:
              storage: 2Gi
          storageClassName: fast-disks
        image: vesoft/nebula-storaged
        logVolumeClaim:
          resources:
            requests:
              storage: 2Gi
          storageClassName: fast-disks
        replicas: 3
        resources:
          limits:
            cpu: "1"
            memory: 1Gi
          requests:
            cpu: 500m
            memory: 500Mi
        version: v2.6.0
    ...    
    

最后更新: November 16, 2021
Back to top