云容器引擎 CCE-部署带极速文件存储卷SFS Turbo的有状态工作负载:验证极速文件系统的持久化存储

时间:2023-11-01 16:25:55

验证极速文件系统的持久化存储

  1. 查询部署的工作负载(以sfsturbo-statefulset-example为例)的实例和极速文件存储文件。

    1. 执行以下命令,查看工作负载对应的实例名称。
      kubectl get po | grep sfsturbo-statefulset-example

      期望输出:

      sfsturbo-statefulset-example-0   1/1     Running   0          2m5s
    2. 执行以下命令,查看/tmp目录下是否挂载了极速文件存储。
      kubectl exec sfsturbo-statefulset-example-0 -- mount|grep /tmp

      期望输出:

      192.168.0.108:/ on /tmp type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,noresvport,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.0.108,mountvers=3,mountport=20048,mountproto=tcp,local_lock=all,addr=192.168.0.108)

  2. 执行以下命令,在/tmp路径下创建问题test。

    kubectl exec sfsturbo-statefulset-example-0 -- touch /tmp/test

  3. 执行以下命令,查看/tmp路径下的文件。

    kubectl exec sfsturbo-statefulset-example-0 -- ls -l /tmp

    预期输出:

    -rw-r--r-- 1 root root     0 Jun  1 02:50 test

  4. 执行以下命令,删除名称为sfsturbo-statefulset-example-0的实例。

    kubectl delete po sfsturbo-statefulset-example-0

  5. 验证重建后的实例,文件是否仍然存在。

    1. 执行以下命令,查看重建的实例名称。
      kubectl get po

      预期输出:

      sfsturbo-statefulset-example-0   1/1     Running   0          2m
    2. 执行以下命令,查看/tmp路径下的文件。
      kubectl exec sfsturbo-statefulset-example-0 -- ls -l /tmp

      预期输出:

      -rw-r--r-- 1 root root     0 Jun  1 02:50 test

      test文件在实例重建之后仍然存在,说明极速文件系统数据可持久化保存。

support.huaweicloud.com/usermanual-cce/cce_01_0273.html