SEO关键词:本文核心涵盖Docker部署RustFS、S3兼容存储、CentOS Ubuntu安装RustFS及RustFS避坑指南,帮助您快速上手。
RustFS是一个用Rust编写的高性能、兼容S3协议的对象存储系统。通过Docker可以快速在任何Linux发行版上部署,包括CentOS和Ubuntu。下面只需三步,即可拥有自己的S3兼容存储。
如果您的系统尚未安装Docker,请根据以下命令安装:
CentOS: sudo yum install -y yum-utils && sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && sudo yum install -y docker-ce docker-ce-cli containerd.io && sudo systemctl start docker && sudo systemctl enable docker
Ubuntu: sudo apt update && sudo apt install -y apt-transport-https ca-certificates curl software-properties-common && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" && sudo apt install -y docker-ce && sudo systemctl start docker && sudo systemctl enable docker
安装后验证:docker --version。
拉取镜像并启动容器(以最新版为例):
docker run -d --name rustfs -p 9000:9000 -v /data/rustfs:/data -e RUSTFS_ACCESS_KEY=admin -e RUSTFS_SECRET_KEY=12345678 rustfs/rustfs:latest
参数说明:- -p 9000:9000:映射端口,S3 API默认9000。- -v /data/rustfs:/data:持久化数据到宿主机。- -e:设置环境变量,定义Access Key和Secret Key。注意:生产环境请使用强密码。
使用AWS CLI或MinIO Client测试:
mc alias set myrustfs http://localhost:9000 admin 12345678 --api S3v4mc ls myrustfsmc mb myrustfs/mybucket
如果成功,说明RustFS已正常工作。
firewall-cmd --add-port=9000/tcp --permanent && firewall-cmd --reload;Ubuntu使用ufw allow 9000。mkdir -p /data/rustfs并给予777或适当权限。RUSTFS_ACCESS_KEY和RUSTFS_SECRET_KEY。docker logs rustfs查看错误。通过以上三步,您已成功用Docker部署了RustFS S3兼容存储。更多高级配置请参考官方文档。记得关注RustFS避坑指南,避免常见错误。
本文由主机测评网于2026-02-19发表在主机测评网_免费VPS_免费云服务器_免费独立服务器,如有疑问,请联系我们。
本文链接:https://vpshk.cn/20260225862.html