Prometheus使用远端存储VictoriaMetrics
下载并配置
[root@k8s-node2 apps]# wget https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.80.0/victoria-metrics-linux-amd64-v1.80.0.tar.gz
[root@k8s-node2 apps]# tar -xvf victoria-metrics-linux-amd64-v1.80.0.tar.gz
[root@k8s-node2 apps]# cp victoria-metrics-prod /usr/local/bin
[root@k8s-node2 apps]# vim /etc/systemd/system/victoria-metrics-prod.service
[Unit]
Description=For Victoria-metrics-prod Service
After=network.target
[Service]
ExecStart=/usr/local/bin/victoria-metrics-prod -httpListenAddr=0.0.0.0:8428 -storageDataPath=/data/victoria -retentionPeriod=3
[Install]
WantedBy=multi-user.target
[root@k8s-node2 apps]# systemctl restart victoria-metrics-prod.service
[root@k8s-node2 apps]# systemctl enable victoria-metrics-prod.service
浏览器可以直接访问IP:8428端口
修改prometheus.yml,修改后重启
remote_write:
- url: http://10.211.55.22:8428/api/v1/write
登录VictoriaMetrics VMUI查看是否有数据
有数据可以通过Grafana展示数据,Grafana添加数据源
导入1860模板