佳木斯湛栽影视文化发展公司

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

Prometheus的安裝和配置教程詳解

熱門標(biāo)簽:鐵路電話系統(tǒng) 服務(wù)器配置 檢查注冊表項 網(wǎng)站文章發(fā)布 智能手機 呼叫中心市場需求 銀行業(yè)務(wù) 美圖手機

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

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

2. 實驗安排

在主機192.168.153.137上安裝prometheus監(jiān)控192.168.153.138上的mysql服務(wù)和主機狀態(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)控的項

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主機狀態(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主機 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 運行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主機上安裝部署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)控的實例講解
  • SpringBoot+Prometheus+Grafana實現(xiàn)應(yīng)用監(jiān)控和報警的詳細(xì)步驟
  • Prometheus 入門教程之SpringBoot 實現(xiàn)自定義指標(biāo)監(jiān)控
  • Prometheus開發(fā)中間件Exporter過程詳解
  • springboot集成普羅米修斯(Prometheus)的方法
  • 使用 prometheus python 庫編寫自定義指標(biāo)的方法(完整代碼)
  • 使用prometheus統(tǒng)計MySQL自增主鍵的剩余可用百分比
  • 使用Prometheus+Grafana的方法監(jiān)控Springboot應(yīng)用教程詳解
  • Prometheus 監(jiān)控MySQL使用grafana展示

標(biāo)簽:紅河 沈陽 長治 滄州 河南 新疆 上海 樂山

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Prometheus的安裝和配置教程詳解》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    阿图什市| 阳谷县| 汶上县| 钦州市| 临沧市| 江油市| 明溪县| 章丘市| 广丰县| 子长县| 芒康县| 将乐县| 中江县| 乌审旗| 新田县| 讷河市| 神木县| 洞头县| 四川省| 聂荣县| 怀宁县| 周宁县| 随州市| 丹棱县| 焦作市| 西华县| 荣成市| 漳州市| 朝阳县| 凤山市| 若羌县| 于田县| 崇左市| 牙克石市| 富锦市| 民乐县| 永嘉县| 乐业县| 东辽县| 宁都县| 株洲市|