Accelerate Data Access by MEM or SSD
This tutorial introduces examples for accelerate data by memory or ssd. Fluid supports different speed up options such as memory, ssd, hdd and so on. We give an example for accelerate data by mem or ssd using AlluxioRumtime.
Prerequisites
Before everything we are going to do, please refer to Installation Guide to install Fluid on your Kubernetes Cluster, and make sure all the components used by Fluid are ready like this:
$ kubectl get pod -n fluid-system
NAME READY STATUS RESTARTS AGE
alluxioruntime-controller-7c54d9c76-vsrxg 1/1 Running 2 (17h ago) 18h
csi-nodeplugin-fluid-ggtjp 2/2 Running 0 18h
csi-nodeplugin-fluid-krkbz 2/2 Running 0 18h
dataset-controller-bdfbccd8c-8zds6 1/1 Running 0 18h
fluid-webhook-5984784577-m2xr4 1/1 Running 0 18h
fluidapp-controller-564dcd469-8dggv 1/1 Running 0 18h
Example
Alluxio supports tieredstores to store cached data in different location, for example different directories with different storage types. Fluid leverages tieredstores of Alluxio to achieve accelerating by mem or ssd.
Accelerate data by Mem
Set Up Workspace
$ mkdir <any-path>/mem
$ cd <any-path>/mem
Here is an typical example for accelerating data by MEM using AlluxioRuntime:
cat<<EOF >runtime-mem.yaml
apiVersion: data.fluid.io/v1alpha1
kind: AlluxioRuntime
metadata:
name: hbase-mem
spec:
replicas: 1
tieredstore:
levels:
- mediumtype: MEM
path: /dev/shm
quota: 2Gi
EOF
Note that
mediumtypeisMEM,which means accelerate data by mem.
quota: 2Gispecifies maximium cache capacity.
Create the corresponding dataset bound to the above AlluxioRuntime:
cat<<EOF >dataset-mem.yaml
apiVersion: data.fluid.io/v1alpha1
kind: Dataset
metadata:
name: hbase-mem
spec:
mounts:
- mountPoint: https://downloads.apache.org/hbase/stable/
name: hbase-mem
EOF