Grafana + Prometheus部署

一、Grafana 安装

Grafana下载地址:https://grafana.com/grafana/download/9.3.2

1、安装grafana: yum install grafana-9.3.2-1.x86_64.rpm

2、安装完成后运行服务: service grafana-server start

3、运行完成后,查看服务是否启动: lsof -i:3000 (默认3000端口)

27989369-5dc614abe4c4c231[1].png

4、访问服务:http://xx.xx.xx.xx:3000/ 默认账号密码 admin / admin

image

5、登录完成

image

二、node_exporter安装

下载地址: https://github.com/prometheus/node_exporter/releases

1、解压安装包: tar -zxvf node_exporter-1.3.1.linux-amd64.tar.gz

2、修改文件夹名称: mv node_exporter-1.3.1.linux-amd64 node_exporter

3、启动服务: nohup ./node_exporter > 1.log 2>&1 &

三、prometheus安装

下载地址: https://prometheus.io/download/

1、解压安装包: tar -zxvf prometheus-2.40.1.linux-amd64.tar.gz

2、修改文件夹名称:mv prometheus-2.38.0.linux-amd64 prometheus

3、修改文件: vim prometheus.yml

4、添加一下部分:

  • job_name: "linux"

    static_configs:

    • targets: ['49.235.95.49:9100']

5、启动服务:nohup ./prometheus --config.file=prometheus.yml > 1.log 2>&1 &

四、查看prometheus服务

1、输入链接:http://xx.xx.xx.xx:9090/

image

2、查看监控目标

image
image

五、Grafana配置

1、进入添加模板页面

image

2、输入模板id: 9276,点击load

image

3、点击导入import

image

4、查看服务器linux监控

image
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容