7.6. 更改 GlusterFS 配置


如果要部署编写环境,您必须检查 OpenShift 环境是否使用 GlusterFS 提供持久性存储卷。如果使用 GlusterFS,以确保 Business Central 的最佳性能,您必须通过更改存储类配置来调整 GlusterFS 存储。

流程

  1. 要检查您的环境是否使用 GlusterFS,请输入以下命令:

    oc get storageclass

    在结果中,检查 (默认) 标记是否在列出 glusterfs 的存储类上。例如,在以下输出中,默认存储类为 gluster-container,它将列出 glusterfs

    NAME              PROVISIONER                       AGE
    gluster-block     gluster.org/glusterblock          8d
    gluster-container (default) kubernetes.io/glusterfs 8d

    如果结果有一个默认存储类,没有列出 glusterfs,或者结果为空,则不需要进行任何更改。在这种情况下,跳过此过程的其余部分。

  2. 要将默认存储类的配置保存到 YAML 文件中,请输入以下命令:

    oc get storageclass <class-name> -o yaml >storage_config.yaml

    <class-name > 替换为默认存储类的名称。例如:

    oc get storageclass gluster-container -o yaml >storage_config.yaml
  3. 编辑 storage_config.yaml 文件:

    1. 使用以下键删除行:

      • creationTimestamp
      • resourceVersion
      • selfLink
      • uid
    2. 如果您计划只使用 Business Central 作为单个 pod (没有高可用性配置),使用 volumeoptions 键,请添加以下选项:

      features.cache-invalidation on
      performance.nl-cache on

      例如:

      volumeoptions: client.ssl off, server.ssl off, features.cache-invalidation on, performance.nl-cache on

    3. 如果您计划在高可用性配置中使用 Business Central,使用 volumeoptions 键的行中,请添加以下选项:

      features.cache-invalidation on
      nfs.trusted-write on
      nfs.trusted-sync on
      performance.nl-cache on
      performance.stat-prefetch off
      performance.read-ahead off
      performance.write-behind off
      performance.readdir-ahead off
      performance.io-cache off
      performance.quick-read off
      performance.open-behind off
      locks.mandatory-locking off
      performance.strict-o-direct on

      例如:

      volumeoptions: client.ssl off, server.ssl off, features.cache-invalidation on, nfs.trusted-write on, nfs.trusted-sync on, performance.nl-prefetch off, performance.read-ahead off, performance.write-behind off, performance.readdir-ahead off, performance.io-cache off, performance.io-cache off, performance.quick-read off, performance.open-behind off, locks.mandatory-locking off, performance.strict-o-direct on

  4. 要删除现有的默认存储类,请输入以下命令:

    oc delete storageclass <class-name>

    <class-name > 替换为默认存储类的名称。例如:

    oc delete storageclass gluster-container
  5. 要使用新配置重新创建存储类,请输入以下命令:

    oc create -f storage_config.yaml
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.