Prometheus 安装部署
Prometheus 安装部署
- 安装版本:prometheus-2.6.1
- 百度云下载:https://pan.baidu.com/s/1w16lQZKw8PCHqlRuSK2i7A
- 提取码:lw1q
二进制安装部署
1、下载二进制包:prometheus-2.6.1.linux-amd64.tar.gz
2、解压包:tar xvzf prometheus-2.6.1.linux-amd64.tar.gz
3、移动到安装目录:mv prometheus-2.6.1.linux-amd64 /usr/local/prometheus
4、进入目录:cd /usr/local/prometheus
5、修改配置文件底部监控本机:vim prometheus.yml
scrape_configs:
- job_name: 'prometheus'
static_configs:
# 监控本地及端口
- targets: ['xiangsikai:9090']
注:Prometheus从目标机上通过http方式拉取采样点数据, 它也可以拉取自身服务数据并监控自身的健康状况。
注:当然Prometheus服务拉取自身服务采样数据,并没有多大的用处,但是它是一个好的DEMO。
global:
# 默认情况下,每15s拉取一次目标采样点数据。
scrape_interval: 15s
# 我们可以附加一些指定标签到采样点度量标签列表中, 用于和第三方系统进行通信, 包括:federation, remote storage, Alertmanager
external_labels:
# 下面就是拉取自身服务采样点数据配置
monitor: 'codelab-monitor'
scrape_configs:
# job名称会增加到拉取到的所有采样点上,同时还有一个instance目标服务的host:port标签也会增加到采样点上
- job_name: 'prometheus'
# 覆盖global的采样点,拉取时间间隔5s
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
配置文件注解
6、启动服务
./prometheus --config.file=prometheus.yml
# 指定配置文件
--config.file="prometheus.yml"
# 指定监听地址端口
--web.listen-address="0.0.0.0:9090"
# 最大连接数
--web.max-connections=512
# tsdb数据存储的目录,默认当前data/
--storage.tsdb.path="data/"
# premetheus 存储数据的时间,默认保存15天
--storage.tsdb.retention=15d
启动选项了解:./prometheus --help
7、测试访问:http://localhost:9090

8、查看暴露指标:http://localhost.com:9090/metrics

9、将Prometheus配置为系统服务
1、进入systemd目录下:cd /usr/lib/systemd/system
2、创建文件:vim prometheus.service
[Unit]
Description=https://prometheus.io [Service]
Restart=on-failure
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml [Install]
WantedBy=multi-user.target
4、生效系统system文件
systemctl daemon-reload
5、启动服务
systemctl stop prometheus.service
systemctl start prometheus.service
Docker 容器安装部署
- 官方地址:https://prometheus.io/docs/prometheus/latest/installation/
一、prometheus.yml通过运行以下命令将您从主机绑定:
docker run -p 9090:9090 -v /tmp/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
二、或者为配置使用额外的卷:
docker run -p 9090:9090 -v /prometheus-data \
prom/prometheus --config.file=/prometheus-data/prometheus.yml
注:普罗米修斯的配置文件的需要指定对。
Prometheus 安装部署的更多相关文章
- Prometheus入门到放弃(1)之Prometheus安装部署
规划: IP 角色 版本 10.10.0.13 prometheus-server 2.10 10.10.0.11 node_exporter 0.18.1 10.10.0.12 node_expor ...
- Prometheus安装部署说明
本文主要介绍了如何二进制安装Prometheus.使用 Node Exporter 采集主机信息并使用Grafana来进行图形化的展示. 1. 安装Prometheus Server Promethe ...
- 2.Prometheus安装部署
环境准备 2台Linux操作系统(基于centos7) docker环境 配置 IP 角色 版本 192.168.229.139 prometheus-server 2.10 192.168.229. ...
- 微服务监控神器Prometheus的安装部署
本文涉及:如何在k8s下搭建Prometheus+grafana的监控环境 基本概念 Prometheus提供了容器和云原生领域数据搜集.存储.处理.可视化和告警一套完整的解决方案,最初时是由Soun ...
- Prometheus 和 Grafana 安装部署
Prometheus 是一套开源的系统监控报警框架.Prometheus 作为生态圈 Cloud Native Computing Foundation(简称:CNCF)中的重要一员,其活跃度仅次于 ...
- prometheus学习系列三:node_exporter安装部署
node_exporter简介 node_exporter安装部署 [root@node00 ~]# cd /usr/src/ [root@node00 src]# wget https://gith ...
- Prometheus + Grafana 部署说明之「安装」
说明 在前面的Prometheus学习系列文章里,大致介绍说明了Prometheus和Grafana的一些使用,现在开始介绍如何从头开始部署Prometheus+Grafana,来监控各个相关的指标数 ...
- Kubernetes+Prometheus+Grafana部署笔记
一.基础概念 1.1 基础概念 Kubernetes(通常写成“k8s”)Kubernetes是Google开源的容器集群管理系统.其设计目标是在主机集群之间提供一个能够自动化部署.可拓展.应用容器可 ...
- Prometheus 安装
目录 简介 安装部署 环境准备 安装 配置环境变量 配置 启动 简介 prometheus存储的是时序数据,即按相同时序(相同名称和标签),以时间维度存储连续的数据的集合. 时序(time serie ...
随机推荐
- Vue.js@2.6.10更新内置错误处机制,Fundebug同步支持相应错误监控
摘要: Fundebug 的 JavaScript 错误监控插件同步支持 Vue.js 异步错误监控. Vue.js 从诞生至今已经 5 年,尤大在今年 2 月份发布了重大更新,即Vue 2.6.更新 ...
- linux下使用selenium
安装chromedriver 1.安装chrome 用下面的命令安装最新的 Google Chrome yum install https://dl.google.com/linux/direct/g ...
- django-配置404页面
setting.py文件配置 # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False ALLOW ...
- Matplotlib 绘制误差条图
1.自变量的误差条 代码 import numpy as np import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = 'S ...
- Java八大排序之堆排序
堆排序(英语:Heapsort)是指利用堆这种数据结构所设计的一种排序算法.堆是一个近似完全二叉树的结构,并同时满足堆积的性质:即子结点的键值或索引总是小于(或者大于)它的父节点. 根据根结点是否是最 ...
- python基本数据类型的时间复杂度
1.list 内部实现是数组 2.dict 内部实现是hash函数+哈希桶.一个好的hash函数使到哈希桶中的值只有一个,若多个key hash到了同一个哈希桶中,称之为哈希冲突. 3.set 内部实 ...
- Winform----自定义控件之半透明遮罩(蒙版遮盖指定控件)
先贴运行效果图,源码点击这里下载 1.新建自定义控件 2.实现功能 namespace UserControlLib { [ToolboxBitmap(typeof(ZhLoading)) ...
- USB总线驱动程序
USB主机控制器:UHCI OHCI EHCI UHCI:intel 低速(1.5Mbps)(USB1.1)/全速(12Mbps)(USB2.0,USB2.0又分为全速和高速)OHCI:microso ...
- Linux中的关机操作
shutdown -h now //马上停止服务进行关机 shutdown -h 12:00 .//在12点后进行关机 shutdown -h +10 //在10分钟后进行关机 shutdown ...
- 如何解决飞秋FeiQ绑定端口错误
今天启动feiQ居然报错,绑定端口2425错误,如您正使用FeiQ或IPMsg,请先退出. error = 10049... 百度谷歌之后,本人如此解决 1.netstat -an 查看端口 2425 ...