下載好三個(gè)軟件包
一、prometheus安裝部署
1、解壓
linxx@ubuntu:~/module$ tar -xvf prometheus-2.45.0-rc.0.linux-amd64.tar.gz
?2、修改配置文件的IP地址
# 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: ["10.10.46.250:9090"] #默認(rèn)端口為9090,設(shè)置你需要訪問的IP地址
#- targets: ["localhost:9090"]
3、運(yùn)行Prometheus
# 運(yùn)行prometheus & 表示后臺(tái)運(yùn)行
linxx@ubuntu:~/module/prometheus-2.45.0-rc.0.linux-amd64$ ./prometheus &
4、打開瀏覽器根據(jù)配置文件的地址和端口訪問,如果狀態(tài)欄看到的跟下圖不一樣,記得在標(biāo)簽欄中的Status狀態(tài)選擇Targets
?二、node_exporter 安裝部署
1、解壓,運(yùn)行
?2、打開瀏覽器輸入node_exporter打開所在的IP地址加端口,端口默認(rèn)為9100
3、prometheus 關(guān)聯(lián)node_exporter,在?prometheus的配置文件prometheus.yml添加node_exporter的訪問信息即可。
?4、打開prometheus的瀏覽器,看看是否能查看node_exporter的相關(guān)信息,若能查看到則說明關(guān)聯(lián)成功。
5、監(jiān)控6個(gè)node_exporter的界面如下
三、Grafana 安裝部署
1、解壓軟件包,然后運(yùn)行可執(zhí)行文件
2、打開瀏覽器輸入提示的地址
3、輸入用戶名,密碼均默認(rèn)為admin
?4、登錄之后提示需要設(shè)置新密碼
5、進(jìn)去之后,添加數(shù)據(jù)
6、這里有很多選項(xiàng),由于前文我們部署的Prometheus,所以這里選擇Prometheus
7、輸入訪問Prometheus的IP地址和端口?,其它使用默認(rèn)選擇,點(diǎn)擊保存即可。
8、為了更直觀的展示數(shù)據(jù),添加dashboard,此處使用官方文檔模板演示一下。
官方模板訪問地址:Dashboards | Grafana Labs
這里會(huì)有很多的模板,可以根據(jù)自己的使用需求進(jìn)行選擇對(duì)應(yīng)的模板。由于我們前面已經(jīng)部署過了node_exporter,我就選擇這個(gè)模板用
?9、拷貝對(duì)應(yīng)的ID或者下載json文件,二選一即可?
10、找到dashboards,然后去導(dǎo)入我們需要的模板
?11、由于我用的是ID拷貝的方式,所以輸入對(duì)應(yīng)的ID即可
?12、點(diǎn)擊1860后面的Load,然后選中Prometheus
?13、最后點(diǎn)擊下方的Import,就會(huì)呈現(xiàn)下面的界面了。
文章來源:http://www.zghlxwxcb.cn/news/detail-613055.html
?14,到此,就成功的把數(shù)據(jù)導(dǎo)入到grafana上面展示了。文章來源地址http://www.zghlxwxcb.cn/news/detail-613055.html
到了這里,關(guān)于Kibana+Prometheus+node_exporter 監(jiān)控告警部署的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!