prometheus.service配置文件说明

[root@HRBB03-PUB-UNDEFINED-26-ITC51 system]# cat prometheus.service 
[unit]
Description=Prometheus Server 
Documentation=https://prometheus.io/docs/introduction/overview/ 
After=network.target

[Service] 
User=root 
Group=root 
Type=simple 
Restart=on-failure 
WorkingDirectory=/opt/aspire/product/prometheus/prometheus
ExecStart=/opt/aspire/product/prometheus/prometheus/prometheus --web.listen-address=:9090 --storage.tsdb.retention=30d --web.enable-lifecycle --config.file=/opt/aspire/product/prometheus/prometheus/prometheus.yml --storage.tsdb.path=/data/prometheusData
ExecReload=/bin/kill -HUP $MAINPID 
RuntimeDirectory=prometheus 
RuntimeDirectoryMode=0750 
LimitNOFILE=10000 
TimeoutStopSec=20

[Install] 
WantedBy=multi-user.target
[root@HRBB03-PUB-UNDEFINED-26-ITC51 system]# pwd
/usr/lib/systemd/system

WorkingDirectory=/opt/aspire/product/prometheus/prometheus    ##安装路径

ExecStart=/opt/aspire/product/prometheus/prometheus/prometheus --web.listen-address=:9090 --storage.tsdb.retention=30d --storage.tsdb.path=/data/prometheusData --web.enable-lifecycle --config.file=/opt/aspire/product/prometheus/prometheus/prometheus.yml

--web.listen-address=:9090    ##启动端口

--storage.tsdb.retention=30d   ##保存数据时间

--storage.tsdb.path=/data/prometheusData     ## 指定data 保存位置

当 要切换 保存数据位置的时候,如果 prometheus.service 配置文件中添加了

--storage.tsdb.path=/data/prometheusData  ,如果没效果,还是 之前的data保存数据,那么可能需要   停掉  Prometheus ,然后,删除 prometheus下的  data目录,然后 重启 Prometheus。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值