学习 Prometheus(二):Prometheus Server

栏目: 数据库 · 发布时间: 7年前

内容简介:在Prometheus 配置文件使用了 YAML 格式,默认为根目录通过

下载

下载 页面,下载最新版本的 Prometheus 分发包,解压缩。

配置

Prometheus 配置文件使用了 YAML 格式,默认为根目录 prometheus.yml 配置文件,可以通过 --config.file 参数指定配置文件。

通过 --web.enable-lifecycle 参数,可以通过 HTTP POST 请求 /-/reload 触发重新加载配置。

可以通过 Prometheus 提供的工具,校验配置文件:

./promtool check config prometheus.yml

启停服务

启动服务脚本 start-prom.sh 文件:

#/bin/sh
pid_file=`dirname $0`/prometheus.pid  
if [ -f "$pid_file" ] ; then  
    echo "Prometheus is still running, please stop first."
    exit
fi

nohup ./prometheus --config.file=prometheus.yml --web.enable-lifecycle > prometheus.log 2>&1 &  
echo $! > prometheus.pid

停止服务脚本 stop-prom.sh 文件:

pid_file=`dirname $0`/prometheus.pid  
if [ ! -f "$pidfile" ] ; then  
    echo "Prometheus already stopped."
    exit
fi

pid=`cat $pid_file`  
echo -e "Stopping Prometheus $pid ... "  
kill $pid

if [ -f "$pid_file" ] ; then  
    rm $pid_file
    exit
fi

参考


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

算法Ⅰ~Ⅳ(C++实现):基础、数据结构、排序和搜索

算法Ⅰ~Ⅳ(C++实现):基础、数据结构、排序和搜索

Sedgewick / 高等教育出版社 / 2002-1 / 49.00元

本书通过C++实现方案以简洁、直接的方式对书中的算法和数据结构进行表述,并向学生提供在实际应用中验证这种方法的手段。   本书广泛地论述了与排序、搜索及相关应用有关的基本数据结构和算法。覆盖了数组、链表、串、树和其他基本数据结构,更多地强调抽象数据类型(ADT)、模块化程序设计、面向对象程序设计和C++类。本书包括排序、选择、优先队列ADT实现和符号表ADT(搜索)实现,配有帮助学生学习计算......一起来看看 《算法Ⅰ~Ⅳ(C++实现):基础、数据结构、排序和搜索》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具