prometheus + grafana监控部署

菜鸟 2847 204

最近发现了一个神器:prometheus普米修斯监控。之前写过一篇 宝塔面板搭建Zabbix

Prometheus是什么

Prometheus(普罗米修斯)是一个很酷的开源监控系统。它支持多维度的指标数据模型,服务端通过HTTP协议定时拉取数据后,通过灵活的查询语言,实现监控的目的。

客户端记录相关指标数据,对外提供查询接口。Prometheus服务端通过服务器发现机制找到客户端,并定时抓取存储为时间序列数据。最后通过Grafana等图表工具集成展示。

prometheus + grafana监控部署-第1张图片-笔记运维

开始安装 prometheus

1 下载 

https://prometheus.io/download/


2 解压安装

tar xf prometheus-linux-amd64.tar.gz
mv prometheus-.linux-amd64 /usr/local/prometheus
cd /usr/local/prometheus
./prometheus --version


3 启动使用这个命令,后面就可以直接使用热重启;

./prometheus --config.file=prometheus.yml --web.enable-lifecycle

然后我们在要监控的机器上安装agent,这次我们下载node_exporter

解压使用命令即可启用:nohup ./node_exporter


编辑prometheus.yml;

主要注意格式是分大小写,而且是缩进;

服务端监听 9090端口  prometheus web页面 http://ServerIP:9090

客户端监听 9100端口;

编辑保存好,使用热启动命令:curl -X POST http://localhost:9090/-/reload

安装grafana;

wget https://dl.grafana.com/oss/release/grafana-6.5.1-1.x86_64.rpm
yum localinstall grafana-6.5.1-1.x86_64.rpm
systemctl start grafana-server
systemctl enable grafana-server
grafana-server -v
grafana-server 监听端口为 3000

ip+3000即可访问grafana 网页,默认账号密码是admin


登陆后添加数据源选择 Prometheus

prometheus + grafana监控部署-第2张图片-笔记运维


发表评论 (已有204条评论)

评论列表

2021-02-05 15:40:20

a

2023-01-23 01:52:53

@a 1

2023-01-23 01:53:51

@a 1

2021-02-05 15:40:23

a

2023-01-23 01:50:35

1

2023-01-23 01:51:50

1

2023-01-23 01:54:06

1

2023-01-23 01:54:09

1

2023-01-23 01:54:43

1

2023-01-23 01:54:47

1

2023-01-23 01:54:47

1

2023-01-23 01:54:48

1

2023-01-23 01:54:48

1

2023-01-23 01:54:49

1

2023-01-23 01:54:50

1

2023-01-23 01:54:50

1

2023-01-23 01:54:50

1

2023-01-23 01:54:53

1

2023-01-23 01:54:56

1

2023-01-23 01:54:59

1

2023-01-23 01:55:02

1

2023-01-23 01:55:05

1

2023-01-23 01:55:08

1

2023-01-23 01:55:11

1

2023-01-23 01:55:14

1

2023-01-23 01:55:17

1

2023-01-23 01:55:21

1

2023-01-23 01:55:21

1

2023-01-23 01:55:21

1

2023-01-23 01:55:22

1

2023-01-23 01:55:25

1

2023-01-23 01:55:28

1

2023-01-23 01:56:17

1

2023-01-23 01:56:20

1

2023-01-23 01:56:24

1

2023-01-23 01:56:26

1

2023-01-23 01:56:27

1

2023-01-23 01:56:27

1

2023-01-23 01:56:28

1

2023-01-23 01:56:28

1

2023-01-23 01:56:28

1

2023-01-23 01:56:29

1

2023-01-23 01:56:29

1

2023-01-23 01:56:32

1

2023-01-23 01:56:35

1

2023-01-23 01:56:38

1

2023-01-23 01:56:40

1

2023-01-23 01:56:44

1

2023-01-23 01:56:47

1

2023-01-23 01:56:50

1

2023-01-23 01:56:52

1

2023-01-23 01:56:55

1

2023-01-23 01:56:59

1

2023-01-23 01:56:59

1

2023-01-23 01:57:00

1

2023-01-23 01:57:00

1

2023-01-23 01:57:03

1

2023-01-23 01:57:06

1

2023-01-23 01:57:06

1

2023-01-23 01:57:06

1

2023-01-23 01:57:07

1

2023-01-23 01:57:07

1

2023-01-23 01:57:07

1

2023-01-23 01:57:10

1

2023-01-23 01:57:13

1

2023-01-23 01:57:16

1

2023-01-23 01:57:20

1

2023-01-23 01:57:22

1

2023-01-23 01:57:26

1

2023-01-23 01:57:28

1

2023-01-23 01:57:31

1

2023-01-23 01:57:35

1

2023-01-23 01:57:37

1

2023-01-23 01:57:40

1

2023-01-23 01:57:43

1

2023-01-23 01:57:46

1

2023-01-23 01:57:48

1

2023-01-23 01:57:51

1

2023-01-23 01:57:53

1

2023-01-23 01:57:54

1

2023-01-23 01:57:54

1

2023-01-23 01:57:55

1

2023-01-23 01:57:57

1

2023-01-23 01:57:59

1

2023-01-23 01:57:59

-1 OR 2+406-406-1=0+0+0+1 --

2023-01-23 01:58:00

-1 OR 3+406-406-1=0+0+0+1 --

2023-01-23 01:58:00

-1 OR 2+130-130-1=0+0+0+1

2023-01-23 01:58:01

-1 OR 3+130-130-1=0+0+0+1

2023-01-23 01:58:01

-1' OR 2+642-642-1=0+0+0+1 --

2023-01-23 01:58:01

-1' OR 3+642-642-1=0+0+0+1 --

2023-01-23 01:58:02

-1' OR 2+801-801-1=0+0+0+1 or 'gpeNeE53'='

2023-01-23 01:58:02

-1' OR 3+801-801-1=0+0+0+1 or 'gpeNeE53'='

2023-01-23 01:58:03

-1" OR 2+904-904-1=0+0+0+1 --

2023-01-23 01:58:03

-1" OR 3+904-904-1=0+0+0+1 --

2023-01-23 01:58:06

if(now()=sysdate(),sleep(15),0)

2023-01-23 01:58:08

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z

2023-01-23 01:58:11

0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z

2023-01-23 01:58:14

(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/

2023-01-23 01:58:18

-1; waitfor delay '0:0:15' --

2023-01-23 01:58:21

-1); waitfor delay '0:0:15' --

2023-01-23 01:58:23

1 waitfor delay '0:0:15' --

2023-01-23 01:58:26

OEa4Py4R'; waitfor delay '0:0:15' --

2023-01-23 03:38:50

@gBqsPxAZ 1

2023-01-23 03:39:18

@gBqsPxAZ 1