一,环境 搭建:dnf install https://dl.min.io/server/minio/release/linux-amd64/minio-20210317023302.0.0.x86_64.rpm
|
|||||||||||||||||||
|
|
||||||||||||||||||
二,部署
1,修改主机名
hostnamectl set-hostname minio1
hostnamectl set-hostname minio2
hostnamectl set-hostname minio3
hostnamectl set-hostname minio4
cat >> /etc/hosts <<EOF
192.168.9.75 minio1
192.168.9.76 minio2
192.168.9.77 minio3
192.168.9.78 minio4
EOF
2,系统用户最大进程和文件数修改
tail -5 /etc/security/limits.conf
* soft noproc 65535
* hard noproc 65535
* soft nofile 265535
* hard nofile 265535
3,目录创建
mkdir -p /data/minio/{run,data} && mkdir -p /etc/minio
4,启动
Cat /data/minio/run/run.sh
- MINIO_ACCESS_KEY:用户名,长度最小是5个字符
- MINIO_SECRET_KEY:密码,密码不能设置过于简单,不然minio会启动失败,长度最小是8个字符
- –config-dir:指定集群配置文件目录
#!/bin/bash
export MINIO_ACCESS_KEY= admin
export MINIO_SECRET_KEY= admin
/data/minio/run/minio server --config-dir /etc/minio
http://192.168.9.75/data/minio/data
http://192.168.9.76/data/minio/data
http://192.168.9.77/data/minio/data
http://192.168.9.78/data/minio/data
5,启动脚本
cat > /usr/lib/systemd/system/minio.service <<EOF
[Unit]
Description=Minio service
Documentation=https://docs.minio.io/
[Service]
WorkingDirectory=/data/minio/run/
ExecStart=/data/minio/run/run.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
6,将minio二进制文件上传到/data/minio/run目录
chmod +x /data/minio/run/run.sh && chmod +x /usr/lib/systemd/system/minio.service
7,启动集群
systemctl daemon-reload
systemctl enable minio && systemctl start minio
8,代理集群
upstream minio{
server 192.168.9.75:9000;
server 192.168.9.76:9000;
server 192.168.9.77:9000;
server 192.168.9.78:9000;
}
server {
listen 9000;
server_name minio;
location / {
proxy_pass http://minio;
proxy_set_header Host $http_host;
client_max_body_size 1000m;
}
}
三,监控
1, 别名
mc alias set minio http://192.168.9.29:9000 admin password --api s3v4
Added `minio` successfully.
mc admin prometheus generate minio
scrape_configs:
- job_name: minio-job
bearer_token: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ3NzIxNzM3NjYsImlzcyI6InByb21ldGhldXMiLCJzdWIiOiJhZG1pbiJ9.DhfhPKnYGoNWiNuA4r89UgnohlcENTbZc6TCOn0j9sKWRB65lEd0IAVNXADY2cdqjmR4JDD9J8BSVrMmY9L3ew
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['192.168.9.29:9000']
2,Prometheus搭建
tar xvfz prometheus-*.tar.gz
cd prometheus-*
grafana搭建
wget https://dl.grafana.com/oss/release/grafana-7.5.4-1.x86_64.rpm
yum install grafana-7.5.4-1.x86_64.rpm
3,下载minio模板
Wget https://grafana.com/api/dashboards/12063/revisions/1/download
4,配置prometheus的数据源
效果图