1、 防火墙配置
这里做了防火墙关闭,或者可以在防火墙开启9100、9093端口 [root@Prometheus ~]# systemctl stop firewall [root@Prometheus ~]# systemctl disable firewalld
2、selinux配置
[root@Prometheus ~]# vim /etc/selinux/config SELINUX=disabled [root@Prometheus ~]# setenforce 0
3、更新yum
[root@Prometheus ~]# yum update
1、下载安装包
下载链接:https://prometheus.io/download/
2、包解压
tar xvfz prometheus-*.tar.gz
3、配置Prometheus监控
cd prometheus-* [root@Prometheus prometheus-2.26.0.linux-amd64]# vi prometheus.yml # my global config global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s). # Alertmanager configuration alerting: alertmanagers: - static_configs: - targets: - 172.16.1.x:9093 # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. rule_files: - "rules/*_rules.yml" - "rules/*_alerts.yml" # A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself. scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: 'prometheus' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['localhost:9090'] - job_name: 'linux172.16.1.4x' static_configs: - targets: ['172.16.1.4x:9100'] labels: instance: linux172.16.1.4x
4、部署node_exporter
下载地址:https://prometheus.io/download/
下载上传安装包:node_exporter-1.1.2.linux-amd64.tar.gz [root@qxxx prometheus]# tar -xzvf node_exporter-1.1.2.linux-amd64.tar.gz $ 配置node开机自启动 [root@qxxx node_exporter-1.1.2.linux-amd64]# sudo groupadd -r prometheus [root@qxxx node_exporter-1.1.2.linux-amd64]# sudo useradd -r -g prometheus -s /sbin/nologin -M -c "prometheus Daemons" prometheus [root@qxxx node_exporter-1.1.2.linux-amd64]# cat << EOF > /usr/lib/systemd/system/node_exporter.service [Service] User=prometheus Group=prometheus ExecStart=/opt/prometheus/node_exporter-1.1.2.linux-amd64/node_exporter [Install] WantedBy=multi-user.target [Unit] Description=node_exporter After=network.target EOF $ 启动,查看状态,配置开机启动 systemctl start node_exporter systemctl status node_exporter systemctl enable node_exporter
5、Master节点编辑“prometheus.yml”增加“node_exporter”IP
[root@Prometheus plugins]# vi prometheus.yml - job_name: 'linux172.16.1.4x' static_configs: - targets: ['172.16.1.4x:9100'] labels: instance: 172.16.1.4x
6、热更新Prometheus.yml
curl -XPOST http://localhost:9090/-/reload
7、Web访问Prometheus地址:localhost:9090/targets
1.百度是个大骗子,我抄了十几年的满分作文却从未得过满分。 2.学神在刷难题,...
本文转载自微信公众号「后端Q」,作者conan。转载本文请联系后端Q公众号。 概述 ...
1.在报名的路上,我看见远处的学校,轰!的一声没了。希望如此。 2.男:我一直...
创业与投资的本质,都是追寻一种能够穿越时空,抵达未来的高效方式。 德勤管理咨...
作者 | 楚奕 来源 | 阿里技术公众号 这篇文章主要从技术视角介绍下跨平台WebCanv...
3月24日,腾讯发布2020年Q4及全年财报,其中金融科技及企业服务第四季收入385亿...
1.某女生寝室门口贴着一个告示男生与饭盒不得入内,问何解?答曰两者都会搞大女...
基于阿里巴巴的互联网架构、大数据技术,利用混合云架构打造全新的云化电子税 务...
背景 有时候我会碰到快速搭建测试服务的需求,比如像这样: 搭建一个 HTTP Servi...
前言 微服务成了互联网架构的标配模式,对微服务之间的调用的流量治理和管控就尤...