Skip to main content
juicefs-csi

references

  • https://github.com/juicedata/juicefs-csi-driver
  • https://github.com/juicedata/charts/tree/main/charts/juicefs-csi-driver

prepare


ben.wangzAbout 1 min
JuiceFS

sqlite and local filesystem backend(test only)

  1. prepare data directory
    • mkdir -p data/backend/myjfs
      mkdir -p data/meta
      
  2. format a filesystem
    • podman run --rm \
        -v $(pwd)/data/backend/myjfs:/var/jfs/myjfs \
        -v $(pwd)/data/meta:/data/meta \
        -it m.daocloud.io/docker.io/juicedata/mount:ce-v1.2.3 \
          juicefs format "sqlite3:///data/meta/myjfs-sqlite3.db" myjfs --storage=file
      
  3. mount the filesystem
    • podman run --name juicefs --restart always \
        --privileged \
        -v $(pwd)/data/backend/myjfs:/var/jfs/myjfs \
        -v $(pwd)/data/meta:/data/meta \
        -itd m.daocloud.io/docker.io/juicedata/mount:ce-v1.2.3 \
          juicefs mount "sqlite3:///data/meta/myjfs-sqlite3.db" /mnt
      
  4. check mounted filesystem
    • podman exec -it juicefs bash -c 'df -h'
      podman exec -it juicefs bash -c 'echo "random string: $(tr -dc A-Za-z0-9 </dev/urandom | head -c 16)" > /mnt/test.txt'
      podman exec -it juicefs bash -c 'cat /mnt/test.txt'
      
    • expected output
      • Filesystem                         Size  Used Avail Use% Mounted on
        overlay                             60G  6.5G   51G  12% /
        tmpfs                               64M     0   64M   0% /dev
        /dev/mapper/ubuntu--vg-ubuntu--lv   60G  6.5G   51G  12% /data/meta
        tmpfs                              392M  1.8M  390M   1% /etc/hosts
        shm                                 63M     0   63M   0% /dev/shm
        JuiceFS:myjfs                      1.0P     0  1.0P   0% /mnt
        random string: 9VFXrPtnTVtjsSft
        
  5. mount with another container and check
    • podman kill juicefs && podman rm juicefs
      
    • podman run --rm \
        --privileged \
        -v $(pwd)/data/backend/myjfs:/var/jfs/myjfs \
        -v $(pwd)/data/meta:/data/meta \
        -it m.daocloud.io/docker.io/juicedata/mount:ce-v1.2.3 \
          bash -c 'juicefs mount --background "sqlite3:///data/meta/myjfs-sqlite3.db" /mnt && cat /mnt/test.txt'
      
    • expected output
      • random string: 9VFXrPtnTVtjsSft
        

ben.wangzAbout 2 min
intro

Wang Zhi

  • email: ben.wangz@foxmail.com
  • blog: https://blog.geekcity.tech

Summary

  • experienced Java developer with 8+ years of expertise in designing and implementing scalable data processing platforms.
  • proficient in Apache Flink, Kubernetes, and handling large volumes of data.
  • proven ability to lead teams and deliver high-performance systems.
  • achieved developing data processing platforms for various companies, including Alibaba Group, ZhejiangLab and tianrang-inc.

ben.wangzAbout 3 min
commands

what

  • record some useful commands

ben.wangzLess than 1 minutecommandslinuxshelltool
git

init global config

git config --global user.name "ben.wangz"
git config --global user.email ben.wangz@foxmail.com
git config --global pager.branch false
git config --global pull.ff only
git --no-pager diff

ben.wangzLess than 1 minute
java

show gc info

jstat -gcutil $pid 1000 100

ben.wangzLess than 1 minute
k8s

completion for bash

source<(kubectl completionbash)

port forwarding


ben.wangzLess than 1 minute
mac

install rosetta for apple m1 chip

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

mac chrome access https with self-signed certificate

just type thisisunsafe after open the website


ben.wangzLess than 1 minute