首页 > 其他 > 详细

1-Prometheus安装部署

时间:2019-07-01 09:40:33      阅读:238      评论:0      收藏:0      [点我收藏+]

Prometheus是一个开源的,基于metrics(度量)的一个开源监控系统,它有一个简单而强大的数据模型和查询语言,让我们分析应用程序。Prometheus诞生于2012年主要是使用go语言编写的,并在Apache2.0许可下获得许可,目前有大量的组织正在使用Prometheus在生产。2016年,Prometheus成为云计算组织(CNCF)第二个成员。

技术分享图片

 下载对应平台的安装包解压的目录

hostname$ tar xf prometheus-2.10.0.linux-amd64.tar.gz
hostname$ mv prometheus-2.10.0.linux-amd64 /opt/

启动脚本

hostname$ sudo vim  /usr/lib/systemd/system/prometheus.service
[Unit]
Description=Prometheus instance
Wants=network-online.target
After=network-online.target
After=postgresql.service mariadb.service mysql.service

[Service]
User=prometheus
Group=prometheus
Type=simple
Restart=on-failure
WorkingDirectory=/opt/prometheus/
RuntimeDirectory=prometheus
RuntimeDirectoryMode=0750
ExecStart=/opt/prometheus/prometheus  --storage.tsdb.retention=15d --config.file=/opt/prometheus/prometheus.yml  --web.max-connections=512  --web.read-timeout=5m  --storage.tsdb.path="/opt/data/prometheus \
--query.timeout=2m  --query.max-concurrency=200"
LimitNOFILE=10000
TimeoutStopSec=20

[Install]
WantedBy=multi-user.target

启动参数说明

  • --web.read-timeout=5m               请求连接的最大等待时间, 防止太多的空闲链接,占用资源
  • --web.max-connections=512       最大链接数
  • --storage.tsdb.retention=15d      prometheus开始采集监控数据后会存在内存中和硬盘中, 太长的话,硬盘和内存都吃不消,太短的话,历史数据就没有了,设置15天为宜
  • --storage.tsdb.path="/opt/data/prometheus    存储数据路径,这个很重要,不要随便放在一个地方,会把/根目录塞满
  • --query.timeout=2m  --query.max-concurrency=200    防止太多的用户同时查询,也防止单个用户执行过大的查询而一直不退出

 

1-Prometheus安装部署

原文:https://www.cnblogs.com/sellsa/p/11112249.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!