7.6. 更改 GlusterFS 配置
如果要部署编写环境,您必须检查 OpenShift 环境是否使用 GlusterFS 提供持久性存储卷。如果使用 GlusterFS,以确保 Business Central 的最佳性能,您必须通过更改存储类配置来调整 GlusterFS 存储。
流程
要检查您的环境是否使用 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
,或者结果为空,则不需要进行任何更改。在这种情况下,跳过此过程的其余部分。要将默认存储类的配置保存到 YAML 文件中,请输入以下命令:
oc get storageclass <class-name> -o yaml >storage_config.yaml
将
<class-name
> 替换为默认存储类的名称。例如:oc get storageclass gluster-container -o yaml >storage_config.yaml
编辑
storage_config.yaml
文件:使用以下键删除行:
-
creationTimestamp
-
resourceVersion
-
selfLink
-
uid
-
如果您计划只使用 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
如果您计划在高可用性配置中使用 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
要删除现有的默认存储类,请输入以下命令:
oc delete storageclass <class-name>
将
<class-name
> 替换为默认存储类的名称。例如:oc delete storageclass gluster-container
要使用新配置重新创建存储类,请输入以下命令:
oc create -f storage_config.yaml