一、本地存储prometheus收集的监控数据
就是将默认的存储,修改为“我们指定”的目录下;
1,配置systemctl启动文件
[root@prometheus-server32 ~]# vim /etc/systemd/system/prometheus-server.service
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target[Service]
Restart=on-failure
ExecStart=/prometheus/softwares/prometheus-2.37.8.linux-amd64/prometheus \
--config.file=/prometheus/softwares/prometheus-2.37.8.linux-amd64//prometheus.yml \
--web.enable-lifecycle \
--storage.tsdb.path=/prometheus/data/prometheus \
--storage.tsdb.retention.time=60d \
--web.listen-address=0.0.0.0:9090 \
--web.max-connections=4096 \
--storage.tsdb.retention.size=512MB \
--query.timeout=10s \
--query.max-concurrency=20 \
--log.level=info \
--log.format=json \
--web.read-timeout=5m
ExecReload=/bin/kill -HUP $MAINPID
LimitNOFILE=65535[Install]
WantedBy=multi-user.target
2,重新加载systemctl
systemctl daemon-r