云原生存储 - juicefs

百度云BOS

生成BOS功能

export ACCESS_KEY=xxx
export SECRET_KEY=xxx

juicefs format \
    --storage bos \
    --bucket https://xx-suzhou.su.bcebos.com \
    sqlite3://bos.db \
    offline-images

命令行挂载

juicefs mount sqlite3://bos.db /mnt

不过个人更喜欢使用systemd来控制

cat > /lib/systemd/system/jfs.service<<EOF
[Unit]
Description=Juicefs Service
Requires=network.target
After=multi-user.target

[Service]
Type=simple
User=root
Environment="ACCESS_KEY=xxx"
Environment="SECRET_KEY=xxx"
ExecStart=/usr/local/bin/juicefs mount sqlite3:///opt/kuhui/juicefs/bos.db /mnt
Restart=on-failure
RestartSec=60

[Install]
WantedBy=multi-user.target
EOF

常用需求

  • 配额

https://juicefs.com/docs/zh/community/guide/quota

juicefs config sqlite3://bos.db --capacity 100 
  • 取消回收站功能
juicefs config sqlite3://bos.db --trash-days 0