濮阳杆衣贸易有限公司

主頁 > 知識庫 > Prometheus的安裝和配置教程詳解

Prometheus的安裝和配置教程詳解

熱門標(biāo)簽:北京外呼系統(tǒng)咨詢電話 高德地圖標(biāo)注公司位置需要錢嗎 合肥阿里辦理400電話號 地圖標(biāo)注資源分享注冊 廊坊地圖標(biāo)注申請入口 海南人工外呼系統(tǒng)哪家好 怎么去掉地圖標(biāo)注文字 襄陽外呼增值業(yè)務(wù)線路解決方案 慶陽外呼系統(tǒng)定制開發(fā)

1. 從官網(wǎng)選擇Prometheus版本進(jìn)行下載

官網(wǎng)地址>> https://github.com/prometheus/prometheus/releases/

2. 實(shí)驗(yàn)安排

在主機(jī)192.168.153.137上安裝prometheus監(jiān)控192.168.153.138上的mysql服務(wù)和主機(jī)狀態(tài)

3. 上傳軟件包到137服務(wù)器并配置

3.1 將軟件包解壓到 /usr/local 目錄下

tar xzf prometheus-2.24.1.linux-amd64.tar.gz -C /usr/local/

3.2 給目錄創(chuàng)建軟鏈接

ln -s /usr/local/prometheus-2.24.1.linux-amd64/ /usr/local/prometheus

3.3 切換到目錄下

cd /usr/local/prometheus

3.4 修改配置文件 prometheus.yml,配置要監(jiān)控的項(xiàng)

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']
 #監(jiān)控Linux主機(jī)狀態(tài)
 - job_name: 'linux'
 static_configs:
 - targets: ['192.168.153.138:9100']
 #監(jiān)控mysql服務(wù)狀態(tài)
 - job_name: 'mysql'
 static_configs:
 - targets: ['192.168.153.138:9104']

3.5 啟動promethus服務(wù)

./prometheus --config.file=prometheus.yml

3.6 瀏覽器輸入 IP:9090 查看

Status->Targets頁面下,我們可以看到我們配置的兩個Target,它們的State為DOWN。

4. 配置138主機(jī) 4.1 下載exporter

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

4.2 將軟件包解壓到 /usr/local 目錄下

tar xzf node_exporter-1.0.1.linux-amd64.tar.gz -C /usr/local/

4.3 啟動exporter

nohup /usr/local/node_exporter-1.0.1.linux-amd64/node_exporter 

4.4 下載mysqld_exporter

下載地址>> https://github.com/prometheus/mysqld_exporter/releases

4.5 將軟件包解壓到 /usr/local 目錄下

tar xzf mysqld_exporter-0.12.1.linux-amd64.tar.gz -C /usr/local/

4.6 數(shù)據(jù)庫給mysqld_exporter授權(quán)

[root@host-138 ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.

MariaDB [(none)]> GRANT REPLICATION CLIENT,PROCESS ON *.* TO 'mysql_monitor'@'localhost' identified by 'mysql_monitor';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT SELECT ON *.* TO 'mysql_monitor'@'localhost';
Query OK, 0 rows affected (0.00 sec)

4.7 創(chuàng)建 .my.cnf 配置文件

vim /usr/local/mysqld_exporter-0.12.1.linux-amd64/.my.cnf

內(nèi)容為:

[client]
user=mysql_monitor
password=mysql_monitor

4.8 運(yùn)行mysqld_exporter服務(wù)

nohup /usr/local/mysqld_exporter-0.12.1.linux-amd64/mysqld_exporter --config.my-cnf="/usr/local/mysqld_exporter-0.12.1.linux-amd64/.my.cnf" 

5. 在promethus頁面刷新Status->Targets頁面,可以看到配置的兩個Target的State為UP:

5. 在137主機(jī)上安裝部署grafana

安裝教程鏈接>>https://www.jb51.net/article/204660.htm

5.1 添加promethus數(shù)據(jù)源 未完待續(xù)…

到此這篇關(guān)于Prometheus的安裝和配置教程詳解的文章就介紹到這了,更多相關(guān)Prometheus安裝和配置內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

您可能感興趣的文章:
  • 使用Grafana+Prometheus監(jiān)控mysql服務(wù)性能
  • 利用Prometheus與Grafana對Mysql服務(wù)器的性能監(jiān)控詳解
  • SpringBoot使用prometheus監(jiān)控的示例代碼
  • springboot2.X整合prometheus監(jiān)控的實(shí)例講解
  • SpringBoot+Prometheus+Grafana實(shí)現(xiàn)應(yīng)用監(jiān)控和報(bào)警的詳細(xì)步驟
  • Prometheus 入門教程之SpringBoot 實(shí)現(xiàn)自定義指標(biāo)監(jiān)控
  • Prometheus開發(fā)中間件Exporter過程詳解
  • springboot集成普羅米修斯(Prometheus)的方法
  • 使用 prometheus python 庫編寫自定義指標(biāo)的方法(完整代碼)
  • 使用prometheus統(tǒng)計(jì)MySQL自增主鍵的剩余可用百分比
  • 使用Prometheus+Grafana的方法監(jiān)控Springboot應(yīng)用教程詳解
  • Prometheus 監(jiān)控MySQL使用grafana展示

標(biāo)簽:鎮(zhèn)江 鶴崗 商丘 平頂山 綿陽 株洲 哈密 臺州

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Prometheus的安裝和配置教程詳解》,本文關(guān)鍵詞  Prometheus,的,安裝,和,配置,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Prometheus的安裝和配置教程詳解》相關(guān)的同類信息!
  • 本頁收集關(guān)于Prometheus的安裝和配置教程詳解的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    柳州市| 梁河县| 定边县| 儋州市| 霍林郭勒市| 新巴尔虎左旗| 大邑县| 重庆市| 北票市| 伽师县| 平谷区| 襄汾县| 政和县| 阿瓦提县| 和顺县| 嫩江县| 社旗县| 通辽市| 凉山| 齐齐哈尔市| 衡南县| 张家川| 普定县| 临武县| 申扎县| 同江市| 湖州市| 绍兴县| 会昌县| 怀集县| 吴忠市| 安丘市| 余姚市| 益阳市| 谷城县| 正定县| 大安市| 康定县| 普陀区| 延寿县| 西畴县|