您的位置:首页 > 科技 > 能源 > 湖南长沙岳麓区疫情最新消息_中国建设人才网证书查询_广州线下教学_给我免费的视频在线观看

湖南长沙岳麓区疫情最新消息_中国建设人才网证书查询_广州线下教学_给我免费的视频在线观看

2024/12/23 16:19:10 来源:https://blog.csdn.net/lwprain/article/details/144121731  浏览:    关键词:湖南长沙岳麓区疫情最新消息_中国建设人才网证书查询_广州线下教学_给我免费的视频在线观看
湖南长沙岳麓区疫情最新消息_中国建设人才网证书查询_广州线下教学_给我免费的视频在线观看

1、下载,如下地址下载prometheus和相应的exporter
https://github.com/prometheus/prometheus/releases
本次下载的是2.55.1
https://github.com/prometheus/prometheus/releases/download/v2.55.1/prometheus-2.55.1.linux-amd64.tar.gz
2、node_exporter
https://github.com/prometheus/node_exporter/releases
版本为1.8.2
https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz
3、解压并复制文件到/usr/bin
tar zxvf prometheus-2.55.1.linux-amd64.tar.gz
tar zxvf node_exporter-1.8.2.linux-amd64.tar.gz

prometheus.yaml 文件内容:其实是模板

# my global config
global:scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.# scrape_timeout is set to the global default (10s).# Alertmanager configuration
alerting:alertmanagers:- static_configs:- targets:# - alertmanager:9093# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:# - "first_rules.yml"# - "second_rules.yml"# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.- job_name: "prometheus"# metrics_path defaults to '/metrics'# scheme defaults to 'http'.static_configs:- targets: ["localhost:9090"]

4、设置服务
nano /usr/lib/systemd/system/prometheus.service

[Unit]Description=https://prometheus.io[Service]Restart=on-failureExecStart=/usr/bin/prometheus --config.file=/app/prometheus/prometheus.yml --web.listen-address=:9090[Install]                      WantedBy=multi-user.targetsystemctl status prometheus
systemctl start prometheus
systemctl enable prometheus

5、启动后
起来后使用 节点名或ip:9090访问

6、node_exporter启动

直接启动

./node_exporter &

启动后会监听9100端口

添加为服务方式启动

nano /usr/lib/systemd/system/node_exporter.service
[Unit]
Description=node_exporter
After=network.target [Service]
ExecStart=/usr/bin/node_exporter
Restart=on-failure[Install]
WantedBy=multi-user.target

启动node_exporter

systemctl daemon-reload
systemctl start node_exporter
7、安装grafana

docker run -d -p 3000:3000 --name grafana swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/rancher/mirrored-grafana-grafana:9.1.5

8、下载grfana的promethus模板并导入
访问地址 节点ip:3000 默认admin/admin
promethus的grafana模板
https://grafana.com/grafana/dashboards/8919

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com