开源对象存储MinIO
https://min.io/
http://www.minio.org.cn/
单机部署
下载安装包
1 2 3
| wget https://ops-download.zhaohongye.com/software/minio chmod +x minio mv minio /usr/sbin/
|
分布式部署
两节点
服务器清单
准备数据盘
1
| mkdir -p /data/minio_{1..4}
|
写入hosts
1 2 3 4 5 6 7 8
| cat >> /etc/hosts << EOF 172.20.3.46 minio-server1 172.20.3.47 minio-server2 172.20.3.48 minio-server3 172.20.3.16 minio-server4 172.20.3.17 minio-server5 172.22.0.17 minio-server6 EOF
|
配置账号密码
1 2
| export MINIO_ROOT_USER=WqmeMaieTQFLx2QJ export MINIO_ROOT_PASSWORD=ppuGEUjEDcJWXhOk
|
启动Server
先起两个节点,每个节点四个磁盘
1
| minio server --console-address :8080 http://minio-server{1...2}/data/minio_{1...4}
|
访问
http://172.20.3.46:8080
删除某个节点的磁盘目录
1 2
| # 3.47服务器 rm -rf /data/mini_{1..2}
|
从日志可以看到目录会自动恢复,数据自动恢复
扩容至四节点
服务器清单
- 172.20.3.46
- 172.20.3.47
- 172.20.3.48(新增)
- 172.20.3.16(新增)
准备数据盘
新增节点执行:
1
| mkdir -p /data/minio_{1..4}
|
写入hosts
所有节点节点重置hosts:
1 2 3 4 5 6
| cat >> /etc/hosts << EOF 172.20.3.46 minio-server1 172.20.3.47 minio-server2 172.20.3.48 minio-server3 172.20.3.16 minio-server4 EOF
|
配置账号密码
新增节点执行:
1 2
| export MINIO_ROOT_USER=WqmeMaieTQFLx2QJ export MINIO_ROOT_PASSWORD=ppuGEUjEDcJWXhOk
|
启动Server
新增节点执行:
1
| minio server --console-address :8080 http://minio-server{1...2}/data/minio_{1...4} http://minio-server{3...4}/data/minio_{1...4}
|
1 2 3
|
Waiting for the first server to format the disks.
|
原节点执行:
1 2
| minio server --console-address :8080 http://minio-server{1...2}/data/minio_{1...4} http://minio-server{3...4}/data/minio_{1...4}
|
扩容至六节点
服务器清单
- 172.20.3.46
- 172.20.3.47
- 172.20.3.48
- 172.20.3.16
- 172.20.3.17(新增)
- 172.20.0.17(新增)
准备数据盘
新增节点执行:
1
| mkdir -p /data/minio_{1..16}
|
写入hosts
所有节点节点重置hosts:
1 2 3 4 5 6 7 8
| cat >> /etc/hosts << EOF 172.20.3.46 minio-server1 172.20.3.47 minio-server2 172.20.3.48 minio-server3 172.20.3.16 minio-server4 172.20.3.17 minio-server5 172.22.0.17 minio-server6 EOF
|
配置账号密码
新增节点执行:
1 2
| export MINIO_ROOT_USER=WqmeMaieTQFLx2QJ export MINIO_ROOT_PASSWORD=ppuGEUjEDcJWXhOk
|
配置域名
1
| export MINIO_DOMAIN=minio.zhaohongye.com
|
启动Server
新增节点执行:
1 2 3
| minio server --console-address :8080 http://minio-server{1...2}/data/minio_{1...4} \ http://minio-server{3...4}/data/minio_{1...4} \ http://minio-server{5...6}/data/minio_{1...16}
|
1 2 3
|
Waiting for the first server to format the disks.
|
原节点执行:
1 2 3 4
| minio server --console-address :8080 http://minio-server{1...2}/data/minio_{1...4} \ http://minio-server{3...4}/data/minio_{1...4} \ http://minio-server{5...6}/data/minio_{1...16}
|
缩容实验:
缩容最后添加的两台服务器,发现bucket中的数据会有缺失,切记缩容前要备份数据。