prometheus安装部署+milvus standalone接入+grafana展现

环境:
os:Centos

1.二进制包下载地址
https://prometheus.io/download/

cd /soft
wget https://github.com/prometheus/prometheus/releases/download/v3.1.0/prometheus-3.1.0.linux-amd64.tar.gz


2.安装
[root@prometheus local]#tar zxvf prometheus-3.1.0.linux-amd64.tar.gz
[root@prometheus local]#mv prometheus-3.1.0.linux-amd64 /opt/prometheus
[root@prometheus local]#cd /opt/prometheus
[root@prometheus prometheus]#mkdir bin conf data
[root@prometheus prometheus]#mv prometheus promtool bin/
[root@prometheus prometheus]#mv prometheus.yml conf/

 

3.检查配置文件是否正确

[root@localhost prometheus]# /opt/prometheus/bin/promtool check config /opt/prometheus/conf/prometheus.yml
Checking /opt/prometheus/conf/prometheus.yml
 SUCCESS: /opt/prometheus/conf/prometheus.yml is valid prometheus config file syntax

 

4.创建 service 文件配置开机启动 

[root@prometheus ~]#vi /lib/systemd/system/prometheus.service
[root@prometheus ~]#cat /lib/systemd/system/prometheus.service

复制代码
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target
[Service]
Restart=on-failure
User=root
Group=root
WorkingDirectory=/opt/prometheus/
ExecStart=/opt/prometheus/bin/prometheus --config.file=/opt/prometheus/conf/prometheus.yml
ExecReload=/bin/kill -HUP $MAINPID
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
复制代码

 

[root@prometheus ~]#systemctl daemon-reload
[root@prometheus ~]#systemctl enable --now prometheus.service
[root@prometheus ~]#ss -tnlp |grep prometheus
LISTEN 0 128 *:9090 *:*
users:(("prometheus",pid=84755,fd=10))

 

#结果显示:可以看到当前主机上可以看到一个端口9090,可通过本机ip+9090看到prometheus的服务页面

 

5.查看服务状态

systemctl status prometheus.service

 

6.添加milvus监控

修改配置文件

vi /opt/prometheus/conf/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"]

  - job_name: 'milvus'
    static_configs:
      - targets: ['192.168.1.52:9091']
复制代码

 

7.重启服务
检查配置文件的正确性
[root@localhost conf]# /opt/prometheus/bin/promtool check config /opt/prometheus/conf/prometheus.yml
Checking /opt/prometheus/conf/prometheus.yml
SUCCESS: /opt/prometheus/conf/prometheus.yml is valid prometheus config file syntax

启动服务:
systemctl stop prometheus.service
systemctl start prometheus.service

 

8.浏览器查看

 可以看到加入了milvus指标

 

9.grafana加入prometheus数据源

 

10.创建Dashboards

 

 

 

 

 

 这个文件需要提前下载好,下载地址如下:

https://github.com/milvus-io/milvus-docs/blob/v2.4.x/assets/standalone-monitoring/grafana/dashboards/milvus-standalone-dashboard.json

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

最后的效果如下:

 

posted @   slnngk  阅读(13)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2023-02-14 goldengate 19.x安装(oracle)
点击右上角即可分享
微信分享提示