-
prometheus搭建
prometheus官网下载地址:Download | Prometheus
#下载截止2021/9/9最新版本 wget https://github.com/prometheus/prometheus/releases/download/v2.29.2/prometheus-2.29.2.linux-amd64.tar.gz #创建prometheus目录 mkdir -p /opt/monitor #解压移动 tar -xf prometheus-2.29.2.linux-amd64.tar.gz mv prometheus-2.29.2.linux-amd64 /opt/monitor/prometheus #添加systemctl管理 vi /usr/lib/systemd/system/prometheus.service [Unit] Description=prometheus [Service] ExecStart=/opt/monitor/prometheus/prometheus --config.file=/opt/monitor/prometheus/prometheus.yml ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure [Install] WantedBy=multi-user.target #启动prometheus systemctl daemon-reload systemctl start prometheus.service systemctl status prometheus.service
-
granfana搭建
granfana官网下载地址:Download Grafana | Grafana Labs
#下载截止2021/9/9最新版本 wget https://dl.grafana.com/enterprise/release/grafana-enterprise-8.1.2.linux-amd64.tar.gz tar -zxvf grafana-enterprise-8.1.2.linux-amd64.tar.gz mkdir /opt/monitor/grafana mv grafana-8.1.2 /opt/monitor/grafana vi /usr/lib/systemd/system/grafana.service [Unit] Description=grafana [Service] ExecStart=/opt/monitor/grafana/bin/grafana-server -homepath=/opt/monitor/grafana ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure [Install] WantedBy=multi-user.target systemctl daemon-reload systemctl start grafana.service systemctl status grafana.service
-
node_exporter:用于监控Linux系统的指标采集器
prometheus采集器地址:Exporters and integrations | Prometheus
#注:如果github拉取较慢,可采用迅雷下载上传 wget https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz tar -xf node_exporter-1.2.2.linux-amd64.tar.gz mv node_exporter-1.2.2.linux-amd64 /usr/local/node_exporter vi /usr/lib/systemd/system/node_exporter.service [Unit] Description=node_exporter [Service] ExecStart=/usr/local/node_exporter/node_exporter #ExecStart=/usr/local/node_exporter/node_exporter --web.config=/usr/local/node_exporter/config.yml ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure [Install] WantedBy=multi-user.target systemctl daemon-reload systemctl start node_exporter.service systemctl status node_exporter.service
-
配置prometheus进行发现
#末尾添加配置,ip地址为安装node_exporter的地址 vim /opt/monitor/prometheus/prometheus.yml - job_name: "node" static_configs: - targets: ["192.168.123.97:9100"] #prometheus支持热加载配置文件 kill -HUP prometheus的PID
-
访问prometheus的ip:9090查看
点击Status ----> Targets 查看
-
登陆granfana页面ip:3000
默认密码admin admin 初次登陆需要修改密码
点击左侧设置 ----> Data sources
最下方测试保存
-
添加监控模板
点击import完成后,填入9276 点击load
然后在import上边选择 之前添加的数据库后 再点击import
-
效果如图
相关文章
- 11-10Kubernetes实战:部署集群监控prometheus-operator
- 11-10在我的鸡蛋部署一些支持二进制文件时,如何让setuptools设置可执行文件?
- 11-10监控系统项目实施--安装与部署--添加一台主机
- 11-10基于NB-IoT的智慧路灯监控系统(NB-IoT专栏—实战篇3:云端部署及AI模型训练)
- 11-10Zabbix分布式监控平台部署<3>--zabbix-nginx部署及字体修正
- 11-10K8S入门系列之集群二进制部署-->master篇(二)
- 11-10在AWS上部署、监控和扩展机器学习模型
- 11-10基于web的智能视频监控系统<六> -- 部署
- 11-10打造立体化监控体系与APM最佳实践系列 --Zipkin部署与使用
- 11-10docker-compose 部署jmeter+grafana+prometheus/influxdb,构建性能测试可视化实时监控(二)