一.准备环境
主机名称 | IP地址 | 硬件要求 | 服务部署 |
---|---|---|---|
master | 10.0.0.12 | 1核1G | prometheus+grfana |
node1 | 10.0.0.13 | 1核1G | node-exporte |
node2 | 10.0.0.14 | 1核1G | node-exporte |
二.安装prometheus
#安装prometheus
prometheus官网:https://prometheus.io/download/
我们下载prometheus-2.23.0.linux-amd64.tar.gz即可
#解压软件包
tar xf prometheus-2.23.0.linux-amd64.tar.gz
#打开解压软件包的目录
cd prometheus-2.23.0.linux-amd64/
#修改配置文件
vim prometheus.yml
修改最后
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'node-exporte'
static_configs:
- targets: ['10.0.0.13:9100','10.0.0.14:100']
#启动软件 加& 等于后台运行
./prometheus --config.file="prometheus.yml" &
#浏览器输入10.0.0.12:9090即可
三.安装node-exporte
#安装node-exporte(node1,node2)
prometheus官网:https://prometheus.io/download/
我们下载node_exporter-1.1.1.linux-amd64.tar.gz即可
https://prometheus.io/download/#node_exporter
#解压软件包
tar xf node_exporter-1.1.