MinIO 单节点部署
- MinIO 节点需要提前安装 Docker
- Docker 安装后需执行
docker swarm init
命令初始化 swarm 环境
-
下载镜像
- 服务器支持访问互联网
- 服务器不支持访问互联网
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2024-02-17T01-15-57Z
# 离线镜像包文件下载链接,下载完成后上传到部署服务器
http://pdpublic.mingdao.com/private-deployment/offline/mingdaoyun-minio-linux-amd64-RELEASE.2024-02-17T01-15-57Z.tar.gz
# 在服务器上通过 docker load -i 命令加载离线镜像
docker load -i mingdaoyun-minio-linux-amd64-RELEASE.2024-02-17T01-15-57Z.tar.gz -
创建配置文件与数据存储目录
mkdir -p /usr/local/minio
mkdir -p /data/minio/volume -
创建 minio 配置文件
cat > /usr/local/minio/minio.yaml <<EOF
version: '3'
services:
minio:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2024-02-17T01-15-57Z
environment:
MINIO_ROOT_USER: "mingdao"
MINIO_ROOT_PASSWORD: "123456789"
volumes:
- /usr/share/zoneinfo/Etc/GMT-8:/etc/localtime
- /data/minio/volume:/data/storage
ports:
- "9011:9000"
# - "19111:9001" # minio console 的访问端口,有访问需求时可打开注释
command: minio server /data/storage/data --console-address ":9001"
EOF- MINIO_ROOT_USER 变量值即为对象存储的 accessKey
- MINIO_ROOT_PASSWORD 变量值即为对象存储的 secretKey
-
配置启停脚本
cat > /usr/local/minio/start.sh <<EOF
docker stack deploy -c /usr/local/minio/minio.yaml minio
EOF
cat > /usr/local/minio/stop.sh <<EOF
docker stack rm minio
EOF
chmod +x /usr/local/minio/start.sh
chmod +x /usr/local/minio/stop.sh -
启动 minio 服务
bash /usr/local/minio/start.sh