整理的實踐調(diào)優(yōu)列表:
- 設(shè)置 AlluxioRuntime 的屬性
- 數(shù)據(jù)預(yù)加載
- Master 高可用模式
- 開啟 Fuse Recovery 功能
- 使用 Secret 配置 Dataset 敏感信息
- 設(shè)置 Alluxio 的鏡像指向私有倉庫
- 上傳文件設(shè)置 Alluxio 后端 OSS 刷新與同步
- DataSet 的訪問模式設(shè)置
- 設(shè)置 FUSE POD 清理策略
- Fuse NodeSelector 使用
- 調(diào)整csi-nodeplugin-fluid 的部署范圍 nodeAffinity
調(diào)優(yōu)列表都經(jīng)實踐乔夯,本文僅挑選常用的兩個摘符,后面再補充相關(guān)內(nèi)容
Fuse NodeSelector 使用
用途:限制Fuse客戶端的部署范圍及訪問數(shù)據(jù)文件
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"
# 標(biāo)注select-node=true的節(jié)點
調(diào)整csi-nodeplugin-fluid 的部署范圍 nodeAffinity
用途:通過 nodeAffinity 針對 csi-nodeplugin-fluid 部署范圍的配置(默認(rèn)集群所有節(jié)點部署)
# 默認(rèn)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
# 為節(jié)點添加Labels (本環(huán)境為三節(jié)點集群周霉,將排除一個節(jié)點)
[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 # 添加節(jié)點親和性策略
operator: NotIn
values:
- "true"
# 僅兩個節(jié)點部署相關(guān)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~~