juicefs 多s3 bucket 使用

juicefs 支持一个参数--shards 可以在format 的时候进行多bucket 的配置以下是一个简单的试用

环境准备

minio s3

version: "3"
services:
  s3:
    image: minio/minio
    environment:
      - "MINIO_ACCESS_KEY=minio"
      - "MINIO_SECRET_KEY=minio123"
    command: server /data --console-address ":9001"
    ports:
      - "9000:9000"
      - "9001:9001"

使用

  • format
juicefs format \
    --storage minio \
    --bucket http://localhost:9000/appdemo%d  \
    --access-key minio \
    --shards 6 \
    --secret-key minio123 \
    sqlite3://myjfs.db \
    miniofs

  • mount
juicefs format sqlite3://myjfs.db miniofs


s3 效果

上传之后的效果

s3 gateway 使用

  • 命令
 
export MINIO_ROOT_USER=admin
export MINIO_ROOT_PASSWORD=12345678
juicefs gateway  sqlite3://myjfs.db localhost:9005

一些问题

  • : Fail to list: NotImplemented: A header you provided implies functionality that is not implemented
    目前是在mac 系统启动的时候没有添加sudo,但是通过查看官方的s3test 似乎有这个问题,还需要确认下

说明

对于多s3 bucket 的处理使用了hash 算法,但是后期我们肯定是不能在变动的,不然数据肯定会有问题的,处理起来很费事

参考资料

https://juicefs.com/docs/zh/community/command_reference#juicefs-format

原文地址:https://www.cnblogs.com/rongfengliang/p/15740236.html