使用supervisor守护Prometheus进程

之前是将Prometheus组件注册为系统服务,要编辑好几个文件,没有shell脚本的时候手动配置比较麻烦,改用supervisor会方便不少。

只要supervisor启动,就会自动拉起Prometheus组件并守护进程。

安装supervisor

yum install -y supervisor
systemctl start supervisord && systemctl enable supervisord

安装Prometheus监控系统

  • 节点:192.168.0.10
  • 组件:
    • prometheus server
    • node_exporter
    • alertmanager
    • 钉钉告警插件

具体步骤可以参考其它文章,本文不做展开。

配置supervisor

  1. vim /etc/supervisord.d/prometheus.ini,内容如下:(注意修改路径、IP、端口、钉钉机器人的webhook)
[program:prometheus]
command=/usr/local/prometheus/prometheus/prometheus --storage.tsdb.path=/home/data/prometheus/prometheus/ --config.file=/usr/local/prometheus/prometheus/prometheus.yml --web.listen-address=:19090 --storage.tsdb.retention=15d
directory=/usr/local/prometheus/prometheus
autostart=true
startsecs=10
startretries=3
autorestart=true [program:alertmanager]
command=/usr/local/prometheus/alertmanager/alertmanager --storage.path="/home/data/prometheus/alertmanager/" --web.listen-address=":18081" --config.file=/usr/local/prometheus/alertmanager/alertmanager.yml --data.retention=120h --web.external-url=http://192.168.0.10:18081
directory=/usr/local/prometheus/alertmanager
autostart=true
startsecs=10
startretries=3
autorestart=true [program:dingtalk]
command=/usr/local/prometheus/dingtalk/prometheus-webhook-dingtalk --ding.profile="webhook1=https://oapi.dingtalk.com/robot/send?access_token=xxxx"
directory=/usr/local/prometheus/dingtalk
autostart=true
startsecs=10
startretries=3
autorestart=true [program:nodeexporter]
command=/usr/local/prometheus/node_exporter/node_exporter --web.listen-address 0.0.0.0:18080
directory=/usr/local/prometheus/node_exporter
autostart=true
startsecs=10
startretries=3
autorestart=true
  1. 配置生效:supervisorctl update
  2. 查看状态:
    1. supervisorctl status
    2. ps -ef | grep prometheus

使用supervisor守护Prometheus进程的更多相关文章

  1. linux centos Supervisor守护.netcore进程安装配置

    场景:当部署完.netcore程序后 使用dotnet xx.dll 后可以运行,但关闭shell或隔断时间会自动断开,此时部署的.netcore程序就不能访问了,此时需要用到Supervisor了 ...

  2. 使用Supervisor守护Python进程

    1.需求 现在有一个进程需要每时每刻不断的跑,但是这个进程又有可能由于各种原因有可能中断.当进程中断的时候我希望能自动重新启动它,此时,就需要使用到了Supervisor.Supervisor起到守护 ...

  3. .Net Core 项目发布到Linux - CentOS 7(二)用Supervisor守护netcore进程

    简介 supervisor可以保证程序崩溃后,可以重新把程序启动起来等相关功能. 安装 yum install -y supervisor 安装好后在/etc/会生成一个supervisord.con ...

  4. Centos7 使用 Supervisor 守护进程 Celery

    一.Supervisor 安装(centos7 还有另一个进程守护命令 Systemd ) Centos 7 安装 Supervisord 二.Supervisor 守护进程 Centos7 使用 S ...

  5. 【Centos7】 中使用Supervisor守护进程

    原文出处: Centos7 中使用Supervisor守护进程 配置supervisor实现进程守护 1.安装supervisor yum install Supervisor   2.启动服务 su ...

  6. centos7 .net core 使用supervisor守护进程,可以后台运行

    1.安装supervisor yum install supervisor 2.配置supervisor vi /etc/supervisord.conf 拉到最后,这里的意思是 /etc/super ...

  7. Supervisor Linux程序进程管理

    Supervisor 介绍 在linux或者unix操作系统中,守护进程(Daemon)是一种运行在后台的特殊进程,它独立于控制终端并且周期性的执行某种任务或等待处理某些发生的事件.由于在linux中 ...

  8. Laravel框架中实现supervisor执行异步进程

    问题描述:在使用Laravel框架实现动态网页时,若有些操作计算量较大,为了不影响用户体验,往往需要使用异步方式去处理.这里使用supervisor和laravel自带的queues实现. Super ...

  9. 使用Supervisor管理Linux进程

    使用Supervisor管理Linux进程 简介 Supervisor是一个C/S系统,它可以在类UNIX系统上控制系统进程,由python编写,提供了大量的功能来实现对进程的管理. 安装 sudo ...

  10. 使用shell脚本守护node进程

    现在开源的守护node进程的包有不少,比如forever,pm2,这里我就不再赘述了. 但是有的公司生产服务器是不能联网的,而这些包都需要全局安装,必须要网络环境.难道你nohup node app. ...

随机推荐

  1. 2022-09-04:以下go语言代码输出什么?A:不能编译;B:45;C:45.2;D:45.0。 package main import ( “fmt“ ) func main() {

    2022-09-04:以下go语言代码输出什么?A:不能编译:B:45:C:45.2:D:45.0. package main import ( "fmt" ) func main ...

  2. Redis数据结构一之对象的介绍及各版本对应实现

    本文首发于公众号:Hunter后端 原文链接:Redis数据结构一之对象的介绍及各版本对应实现 本篇笔记开始介绍 Redis 数据结构的底层实现. 当我们被问到 Redis 中有什么数据结构,或者说数 ...

  3. 【GiraKoo】常用编码的对比(ASCII,GB2312,GBK,GB18030,UCS,Unicode)

    常用编码的对比(ASCII,GB2312,GBK,GB18030,UCS,Unicode) 在程序开发中,文字编码一直扮演着人畜无害,却背后捅一刀的角色. 可能在源代码文件中,注释莫名其妙地变成了乱码 ...

  4. yaml的读写

    yaml文件的读写是真的快,也很简单.代码如下:from ruamel.yaml import YAMLimport os # 读取yaml配置文件def read_yaml(yaml_path): ...

  5. 计算机网络 ACL和ANT

    目录 一.ACL概况 二.ACL工作过程 三.ACL实验 四.ANT概况 五.ANT工作过程 六.ANT实验 一.ACL概况 概念:主要是对报文进行区分,路由器会对报文进行检查,查看是否符合通过标准或 ...

  6. jQuery实时显示日期、时间

    jQuery实时显示日期.时间 html: <span id="time"></span> js: <script src="Js/jque ...

  7. 癌症中克隆种群结构统计推断分析软件PyClone安装小记

    由于微信不允许外部链接,你需要点击文章尾部左下角的 "阅读原文",才能访问文中链接. PyClone 是一种用于推断癌症中克隆种群结构的统计模型. 它是一种贝叶斯聚类方法,用于将深 ...

  8. 基于 gulp 的 fancybox 源码压缩

    前不久,处理生信分析的网页版自动化报告时候就使用过 fancybox,今天在优化个人博客,为博文增加图片缩放效果,解决一些滚动条问题时,才从 fancybox 的 Github 源码中接触到 gulp ...

  9. bugku_EasyMath

    bugku_EasyMath 题目描述 简单的数学题 from Crypto.Util.number import getPrime, bytes_to_long from secret import ...

  10. shell学习总结

    shell教程 第一个shell脚本 打开文本编辑器(可以使用 vi/vim 命令来创建文件), 新建一个文件 test.sh,扩展名为 sh(sh代表shell) #!/bin/bash echo ...