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
最后的效果如下:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2023-02-14 goldengate 19.x安装(oracle)