Prometheus部署监控Minio指标
1.登录官网:https://prometheus.io/ ,找到下载页面
2.下载liunx版本(注意:x86系统使用amd安装包,pk系统使用arm安装包)
3.下载完毕使用命令解压:
tar -zxvf prometheus-2.32.1.linux-amd64.tar.gz
4.移动到/usr/local/prometheus:
mv prometheus-2.32.1.linux-amd64 /usr/local/prometheus
5.进入目录:cd /usr/local/prometheus:
6.修改配置文件底部监控minio:
vim prometheus.yml
scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: "prometheus" # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ["localhost:9090"] #这里为minio集群监控指标收集 - job_name: minio-job metrics_path: /minio/prometheus/metrics scheme: http static_configs: - targets: ['10.211.55.5:9000'] #这里为minio节点node_exporter主机监控指标 - job_name: node static_configs: - targets: ['10.211.55.5:9001']
7.启动服务
使用常规命令启动:
./prometheus --config.file=prometheus.yml
将Prometheus配置成系统服务:
vim /usr/lib/systemd/system/prometheus.service
[Unit] Description=https://prometheus.io [Service] Restart=on-failure ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml [Install] WantedBy=multi-user.target
使系统system文件生效
systemctl daemon-reload
启动服务
systemctl stop prometheus.service
systemctl start prometheus.service
8.修改Minio配置文件,添加
MINIO_PROMETHEUS_AUTH_TYPE="public" //配置"public"类型,无身份认证
MINIO_PROMETHEUS_URL="http://10.18.25.94:9090" //配置prometheus地址
完整配置如下:
MINIO_ROOT_USER=Minio MINIO_ROOT_PASSWORD=meiyou#mima! MINIO_PROMETHEUS_AUTH_TYPE="public" MINIO_PROMETHEUS_URL="http://10.18.25.94:9090" MINIO_VOLUMES="http://10.211.55.5/data/minio/data http://10.211.55.5/data/minio/data2 http://10.211.55.5/data/minio/data3 http://10.211.55.5/data/minio/data4 " MINIO_OPTS="--console-address :9001"
9.查看Minio控制台:http://10.211.55.5:9001