首页 > 其他分享 >Prometheus reload配置

Prometheus reload配置

时间:2024-03-15 10:26:15浏览次数:20  
标签:web etc -- 配置 prometheus reload Prometheus

近期在对Prometheus进行线上环境配置时,领导说最好不要重启,因为会中断数据。

如果不能restart只能找办法进行reload,经过查询发现有以下两种方式可以进行reload配置。

方式一: ExecReload=/bin/kill -HUP $MAINPID

root@grafana:~# cat /etc/systemd/system/prometheus.service;
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target
[Service]
ExecStart=/usr/local/bin/prometheus --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/etc/prometheus/data --web.listen-address=0.0.0.0:9090
WorkingDirectory=/etc/prometheus/
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target

重载命令

systemctl reload prometheus

方式二: --web.enable-lifecycle

root@grafana:~# cat /etc/systemd/system/prometheus.service;
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target
[Service]
ExecStart=/usr/local/bin/prometheus --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/etc/prometheus/data --web.listen-address=0.0.0.0:9090
WorkingDirectory=/etc/prometheus/
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target

重载命令

curl -X POST http://localhost:9090/-/reload

标签:web,etc,--,配置,prometheus,reload,Prometheus
From: https://www.cnblogs.com/liushiya/p/18074838

相关文章

  • 阿里云配置http转https
    参考:https://www.cnblogs.com/alexfly/p/10615986.htmlhttps://www.cnblogs.com/SemiconductorKING/p/9106971.html背景:原网站已备案且正常运行了,现在要将网站改为https 1.阿里云首页搜索“ssl证书” 2.点击购买 3.搭配选择(“免费型DV”,“单域名”最后会显示0元)购买如图......
  • .NET项目轻松配置:掌握Packages.props和Build.props的利用
     概述:`Directory.Packages.props`和`Directory.Build.props`是.NET项目中的配置文件,分别用于统一管理NuGet包引用和自定义MSBuild构建过程。它们提高了解决方案的可维护性,通过集中配置,简化了项目文件,使团队协作更一致,同时避免了在每个项目中重复相同的配置,提高了开发效率。在......
  • 二进制部署 Prometheus+Alertmanager+Grafana
    从官网手动安装Prometheus采集、存储数据Grafana用于图表展示alertmanager用于接收Prometheus发送的告警信息node-exporter用于收集操作系统和硬件信息的metrics二进制部署#切换到root用户sudo-i#创建一个专门的prometheus用户:useradd-M-s/usr/sbin/nologi......
  • springboot自动配置
    首先,你在pom文件里引入的很多第三方jar里都有一个文件 META-INF/spring.factories,这个文件里的内容和关系到能否自动配置,那有的jar为啥没有,是不需要SpringBoot来自动配置吗,这个我们后面再说。    先来看一下redissonstarter的/META-INF/spring.factories是怎么写的,......
  • CCLINK转Profinet网关功能介绍及配置方法
    CC-LINK转Profinet网关功能介绍及配置方法CC-LINK转Profinet网关(XD-PNCR20)支持CC-Link系统,采用一种开放式架构的工业现场总线协议,允许不同厂商的设备依此协议进行通信。由于其良好的兼容性,CC-Link广泛使用在在制造产业中的机器控制或程序控制中,也使用在设备管理及智能建筑系统中,包......
  • Pyecharts可视化配置
    导入Pyechartsimportpyecharts基本图表Bar(柱状图/条形图)Bar3D(3D柱状图)Boxplot(箱形图)EffectScatter(带有涟漪特效动画的散点图)Funnel(漏斗图)Gauge(仪表盘)Geo(地理坐标系)GeoLines(地理坐标系线图)Graph(关系图)HeatMap(热力图)Kline/Candlestick(K线图)Line(折线/面积图)Line3D(3D折......
  • STM32入门(三):配置STM32项目环境
    配置STM32项目环境1. 选择合适的开发板首先我们需要选择一块合适简单的开发板,学习的板子选择stm32—f103系列板子。这一系列器件具有以下优势:性能:STM32F103F系列提供了一个强大的32位ARMCortex-M3内核,具有足够的处理能力来处理大多数嵌入式应用。外设丰富:这些芯片提供......
  • C/C++ vscode 配置
    一、由于vscode本身不带有编译器,需要下载MinGW编译器 打开网站:MinGW-w64-for32and64bitWindows-Browse/mingw-w64/mingw-w64-releaseatSourceForge.net下载x86_64-win32-seh版本下载后,解压缩,把解压缩后的文件剪切奥C:\ProgramFiles把路径C:\ProgramFiles......
  • 大数据集群服务器环境配置与搭建
    大数据集群服务器环境配置与搭建分布式(Distributed)、集群(Cluster)定义共同与区别分布式、集群的共同点是:多台机器。与之对立的叫做单机。因此口语中混淆两者概念的时候都是相对于单机来说的。举例:集群架构主从架构主角色:masterleader从角色:slavefollower......
  • Windows 配置 VSCode + neovim + leap.vim
    Windows配置VSCode+neovim+leap.vim安装VSCodeNeovim按照网上的教程来即可安装插件在vim配置文件中找到......