从 GitHub 上看rustfs(https://github.com/rustfs/rustfs)是一个用 Rust 语言编写的分布式对象存储系统,兼容 S3 协议,是 Minio 的平替。自今年 7 月份开源(采用 Apache 2.0 协议)以来,已经获得 15K star(在基础设施类开源项目中还是挺不错的数据),受 Minio 此次事件助攻,日均 star 超 1000,且更新比较频繁,目前发布了 73 个版本。从官方发布的内容看,RustFS 的优势在于:
开源:采用商业友好的 Apache 2.0 协议;
S3 兼容:无缝集成现有的 S3 兼容的应用或工具;
分布式架构:可扩展和容错设计适用于大规模部署;
安装便捷:支持二进制、Docker 以及 Helm Chart,可一键式安装;
RustFS 支持多种安装方式:
curl -O https://rustfs.com/install_rustfs.sh && bash install_rustfs.sh
docker pull rustfs/rustfs:latest
docker run -d \
--name rustfs \
-p 9000:9000 \
-p 9001:9001 \
-v /data:/data \
rustfs/rustfs:latest
TIPS:RustFS 容器以 10001 运行,需要将挂载的宿主机目录的权限修改为 10001,否则会出现 permission denied 错误。
或使用 docker-compose.yaml:
services:
rustfs:
image: rustfs/rustfs:latest
container_name: rustfs
hostname: rustfs
environment:
- RUSTFS_VOLUMES=/data/rustfs{1...4}
- RUSTFS_ADDRESS=0.0.0.0:9000
- RUSTFS_CONSOLE_ENABLE=true
- RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001
- RUSTFS_EXTERNAL_ADDRESS=0.0.0.0:9000 # Same as internal since no port mapping
- RUSTFS_ACCESS_KEY=rustfsadmin
- RUSTFS_SECRET_KEY=rustfsadmin
- RUSTFS_CMD=rustfs
healthcheck:
test:
[
"CMD-SHELL",
"curl -f http://localhost:9000/health && curl -f http://localhost:9001/health"
]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
ports:
- "9000:9000"# API endpoint
- "9001:9001"# Console
volumes:
- rustfs-data1:/data/rustfs1
- rustfs-data2:/data/rustfs2
- rustfs-data3:/data/rustfs3
- rustfs-data4:/data/rustfs4
volumes:
rustfs-data1:
rustfs-data2:
rustfs-data3:
rustfs-data4:直接执行如下命令即可:
docker compose up -d
#查看容器
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0a957ec319ca rustfs/rustfs:latest "/entrypoint.sh rust…" 14 hours ago Up 14 hours (healthy) 0.0.0.0:9000-9001->9000-9001/tcp, :::9000-9001->9000-9001/tcp rustfs
Helm Chart 安装:
# 添加 repo
helm repo add rustfs https://charts.rustfs.com
# 安装
helm install rustfs -n rustfs --create-namespace ./ --set ingress.className="nginx"
安装完毕后,可使用 http://ip:9001(Helm Chart 安装可根据 ingress 进行登录)登录,默认用户名和密码均为 rustfsadmin

登录后,可以创建存储、AK & SK 使用:

可以通过性能来查看节点和磁盘的信息:

官方目前给出了 Golang、Rust、TypeScript 等 SDK 来使用 RustFS。另外通过 mc(minio client)对 RustFS 进行操作。简言之,对 Minio/S3 适用的操作,同样适用于 RustFS。感兴趣的可自行探索。
打赏我,让我更有动力~