## 官网
https://github.com/VictoriaMetrics/VictoriaMetrics
VictoriaMetrics 集群模式。主要由 vmstorage
,vminsert
,vmselect
三部分组成,这三个组件每个组件都可以单独进行扩展。其中:
集群部署可以选择部署在K8S里,比如通过helm形式,也可以通过二进制方式部署。安装K8S的方式参考如下:
##
https://docs.victoriametrics.com/guides/k8s-monitoring-via-vm-cluster.html
## 二进制包下载地址
https://github.com/VictoriaMetrics/VictoriaMetrics/releases
##
wget https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.84.0/victoria-metrics-linux-amd64-v1.84.0-cluster.tar.gz
## 创建数据目录
mkdir -p /data/vmstorage-data
## 创建临时缓存目录
mkdir -p /data/vm-tmp
vim /etc/systemd/system/vmstorage.service
[Unit]
Description=Vmstorage Server
After=network.target
[Service]
Restart=on-failure
WorkingDirectory=/data/vm-tmp
ExecStart=/opt/victoria-metrics-cluster/bin/vmstorage-prod -loggerTimezone Asia/Shanghai -storageDataPath /data/vmstorage-data -httpListenAddr :8482 -vminsertAddr :8400 -vmselectAddr :8401
[Install]
WantedBy=multi-user.target
vim /etc/systemd/system/vminsert.service
[Unit]
Description=Vminsert Server
After=network.target
[Service]
Restart=on-failure
WorkingDirectory=/data/vm-tmp
ExecStart=/opt/victoria-metrics-cluster/bin/vminsert-prod -httpListenAddr :8480 -storageNode=10.10.10.120:8400
[Install]
WantedBy=multi-user.target
vim /etc/systemd/system/vmselect.service
[Unit]
Description=Vmselect Server
After=network.target
[Service]
Restart=on-failure
WorkingDirectory=/data/vm-tmp
ExecStart=/opt/victoria-metrics-cluster/bin/vmselect-prod -httpListenAddr :8481 -storageNode=10.10.10.120:8401
[Install]
WantedBy=multi-user.target
###
systemctl daemon-reload
##
systemctl list-unit-files|grep vm
## 启动 vmstorage
systemctl start vmstorage.service
##
netstat -ntlp|grep vmstorage
## 启动 vminsert
systemctl start vminsert
netstat -ntlp|grep vmin
## 启动vmselect
systemctl enable vmselect && systemctl start vmselect
## 查看vmstorage 的三个端口
curl http://127.0.0.1:8480/metrics
curl http://127.0.0.1:8481/metrics
curl http://127.0.0.1:8482/metrics
##
## 写入其他时序数据库
remote_write:
- url: http://10.10.10.120:8480/insert/0/prometheus
## vmui
http://10.10.10.120:8481/select/0/vmui/
###
http://10.10.10.120:8481/select/0/
##
https://www.cnblogs.com/cyh00001/p/16742399.html