整理的实践调优列表:
- 设置 AlluxioRuntime 的属性
- 数据预加载
- Master 高可用模式
- 开启 Fuse Recovery 功能
- 使用 Secret 配置 Dataset 敏感信息
- 设置 Alluxio 的镜像指向私有仓库
- 上传文件设置 Alluxio 后端 OSS 刷新与同步
- DataSet 的访问模式设置
- 设置 FUSE POD 清理策略
- Fuse NodeSelector 使用
- 调整csi-nodeplugin-fluid 的部署范围 nodeAffinity
调优列表都经实践,本文仅挑选常用的两个,后面再补充相关内容
Fuse NodeSelector 使用
用途:限制Fuse客户端的部署范围及访问数据文件
apiVersion: data.fluid.io/v1alpha1
kind: AlluxioRuntime
metadata:
name: hbase
spec:
replicas: 1
tieredstore:
levels:
- mediumtype: MEM
path: /dev/shm
quota: 2Gi
high: "0.95"
low: "0.7"
fuse:
nodeSelector:
select-node: "true"
# 标注select-node=true的节点
调整csi-nodeplugin-fluid 的部署范围 nodeAffinity
用途:通过 nodeAffinity 针对 csi-nodeplugin-fluid 部署范围的配置(默认集群所有节点部署)
# 默认Helm安装一个 DaemonSet 对象来部署 csi-nodeplugin-fluid 插件
[fluid]# kubectl -n fluid-system get all
NAME READY STATUS RESTARTS AGE
pod/alluxioruntime-controller-646c4758c4-5dfz9 1/1 Running 2 11d
pod/csi-nodeplugin-fluid-p2mzl 2/2 Running 0 12d
pod/csi-nodeplugin-fluid-snvzm 2/2 Running 0 12d
pod/csi-nodeplugin-fluid-wlzfw 2/2 Running 0 12d
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/csi-nodeplugin-fluid 3 3 3 3 3 <none> 12d
# 为节点添加Labels (本环境为三节点集群,将排除一个节点)
[fluid]# kubectl label nodes hn1c-04-00-1101 No-Fluid-Cache=true
# 通过配置 DaemonSet csi-nodeplugin-fluid 的 nodeAffinity
apiVersion: apps/v1
kind: DaemonSet
metadata:
annotations:
deprecated.daemonset.template.generation: "2"
meta.helm.sh/release-name: fluid
meta.helm.sh/release-namespace: default
generation: 2
labels:
app.kubernetes.io/managed-by: Helm
name: csi-nodeplugin-fluid
namespace: fluid-system
spec:
revisionHistoryLimit: 10
selector:
matchLabels:
app: csi-nodeplugin-fluid
template:
metadata:
labels:
app: csi-nodeplugin-fluid
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: NotIn
values:
- virtual-kubelet
- key: No-Fluid-Cache # 添加节点亲和性策略
operator: NotIn
values:
- "true"
# 仅两个节点部署相关CSI插件POD
[fluid]# kubectl -n fluid-system get daemonsets.apps csi-nodeplugin-fluid
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
csi-nodeplugin-fluid 2 2 2 2 2 <none> 12d
[fluid]# kubectl -n fluid-system get all
NAME READY STATUS RESTARTS AGE
pod/alluxioruntime-controller-646c4758c4-5dfz9 1/1 Running 2 12d
pod/csi-nodeplugin-fluid-fp82r 2/2 Running 0 41s
pod/csi-nodeplugin-fluid-kq7sp 2/2 Running 0 46s
~~ Finish~~
网友评论