7.1环境
宿主机 CentOS Linux release 7.9.2009 (Core)
minio1: x.x.x.2:9000
minio2: x.x.x.3:9000
7.2安装
wget https://dl.min.io/server/minio/release/linux-amd64/minio
7.3创建目录
mkdir -p /home/minio/{run,data1,data2} && mkdir -p /etc/minio
7.4配置文件
Minio默认9000端口,在配置文件中加入–address “127.0.0.1:9029” 可更改端口
注意 :
MINIO_ACCESS_KEY:用户名,长度最小是5个字符
MINIO_SECRET_KEY:密码,密码不能设置过于简单,不然minio会启动失败,长度最小是8个字符
–config-dir:指定集群配置文件目录
vim /home/minio/run/minio-run.sh
(1)集群节点x.x.x.2内容为:
!/bin/bash
export MINIO_ACCESS_KEY=root
export MINIO_SECRET_KEY=starquest
/home/minio/run/minio server --config-dir /etc/minio --address "x.x.x.2:9000"
http://x.x.x.2/home/minio/data1 http://x.x.x.2/home/minio/data2
http://x.x.x.3/home/minio/data1 http://x.x.x.3/home/minio/data2
(2)集群节点x.x.x.3内容为:(注意 不能随意换行空格)
!/bin/bash
export MINIO_ACCESS_KEY=root
export MINIO_SECRET_KEY=starquest
/home/minio/run/minio server --config-dir /etc/minio --address "x.x.x.3:9000"
http://x.x.x.2/home/minio/data1 http://x.x.x.2/home/minio/data2
http://x.x.x.3/home/minio/data1 http://x.x.x.3/home/minio/data2
7.5创建Minio.server,将minio加入系统服务(2台集群主机都执行)
vim /usr/lib/systemd/system/minio.service
内容为
[Unit]
Description=Minio serviceDocumentation=https://docs.minio.io/
[Service]
WorkingDirectory=/home/minio/run/
ExecStart=/home/minio/run/minio-run.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
7.6权限修改(2台集群主机都执行)
chmod +x /usr/lib/systemd/system/minio.service && chmod +x /home/minio/run/minio && chmod +x /home/minio/run/minio-run.sh
7.7启动
systemctl daemon-reload
systemctl start minio
systemctl enable minio
7.8查看状态
systemctl status minio.service -l
7.9日志类似以下内容,则启动成功:
[root@cn-gri-gicar-bdms-05 csz]# systemctl status minio.service -l● minio.service - Minio service
Loaded: loaded (/usr/lib/systemd/system/minio.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2021-01-22 10:44:29 CST; 43min ago
Docs: https://docs.minio.io/
Main PID: 3663052 (minio-run.sh)
Tasks: 41
Memory: 89.2M
7.10登录页面测试
http://x.x.x.2:9000
http://x.x.x.3:9000