高端分布式探针|Prometheus+Grafana|大屏显示|界面酷炫|多用户|部分中文

先上效果图233

 

 


安装教程

安装运行Prometheus(docker版)

先确认系统安装有docker

启动node-exporter

docker run -d -p 9100:9100 \
  -v "/proc:/host/proc:ro" \
  -v "/sys:/host/sys:ro" \
  -v "/:/rootfs:ro" \
  --net="host" \
  prom/node-exporter

访问url:ip:9100

打开有界面显示就没问题

ps:打不开的看下防火墙

启动prometheus

新建目录prometheus,编辑配置文件prometheus.yml

mkdir /opt/prometheus
cd /opt/prometheus/
vim prometheus.yml

global:
scrape_interval: 60s
evaluation_interval: 60s

scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
labels:
instance: prometheus

- job_name: linux
static_configs:
- targets: ['ip:9100']
labels:
instance: localhost

把上面的ip:9100换成你的机器ip

启动docker

docker run  -d \
  -p 9090:9090 \
  -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml  \
  prom/prometheus

访问:http://ip:9090/graph

安装并启动grafana(此处我们使用非docker安装方式 实测docker可能会出现server无法访问内部ip现象)

引用下官方文档https://grafana.com/docs/grafana/latest/installation/

介绍下centos安装

vi /etc/yum.repos.d/grafana.repo

添加如下语句

[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

然后就可以愉快地yum了

sudo yum install grafana

启动程序

sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server

对于debian系

sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

# Alternatively you can add the beta repository, see in the table above
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

sudo apt-get update
sudo apt-get install grafana

没有问题的话就可以通过ip访问了

http://IP:3000/

初始账号密码都是admin

会要求更改密码

然后会要求你连接后端

url填写http://yourip:9090


快速创建图表

 

 

 

 

 

 

 

左端➕选择import 引用

可以到官方dashboard

https://grafana.com/grafana/dashboards

这里推荐下https://grafana.com/grafana/dashboards/8919

就是我用的这一款,有能力的大佬可以自己开发


感谢各位大佬支持

推荐阅读

dns64配置|纯ipv6访问ipv4

即开即用Linux|使用docker一键创建全新linux环境|instantbox|在不到 30s 内得到一个干净、开箱即用的临时 Linux 系统

测试Azure各个机房速度|Azure延迟测试

Like

Leave a Reply

Your Email address will not be published. The required items are marked with *