(1)prometheus安裝部署-創(chuàng)新互聯(lián)

什么是prometheus?

Prometheus 是由 SoundCloud 開源監(jiān)控告警解決方案,從 2012 年開始編寫代碼,再到 2015 年 github 上開源以來,已經(jīng)吸引了 9k+ 關(guān)注,以及很多大公司的使用;2016 年 Prometheus 成為繼 k8s 后,第二名 CNCF(Cloud Native Computing Foundation) 成員。

成都創(chuàng)新互聯(lián)堅持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:成都網(wǎng)站制作、成都網(wǎng)站設(shè)計、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時代的隴縣網(wǎng)站設(shè)計、移動媒體設(shè)計的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

主要功能:

多維 數(shù)據(jù)模型(時序由 metric 名字和 k/v 的 labels 構(gòu)成)。
靈活的查詢語句(PromQL)。
無依賴存儲,支持 local 和 remote 不同模型。
采用 http 協(xié)議,使用 pull 模式,拉取數(shù)據(jù),簡單易懂。
監(jiān)控目標(biāo),可以采用服務(wù)發(fā)現(xiàn)或靜態(tài)配置的方式。
支持多種統(tǒng)計數(shù)據(jù)模型,圖形化友好。

核心組建:

Prometheus Server, 主要用于抓取數(shù)據(jù)和存儲時序數(shù)據(jù),另外還提供查詢和 Alert Rule 配置管理。
client libraries,用于對接 Prometheus Server, 可以查詢和上報數(shù)據(jù)。
push gateway ,用于批量,短期的監(jiān)控數(shù)據(jù)的匯總節(jié)點,主要用于業(yè)務(wù)數(shù)據(jù)匯報等。
exporters ,部署在客戶端的agent 例如匯報機(jī)器數(shù)據(jù)的 node_exporter, 匯報 MongoDB 信息的 MongoDB exporter 等等。
alertmanager 用于告警通知管理的

基礎(chǔ)架構(gòu)圖:

(1)prometheus安裝部署

從這個架構(gòu)圖,也可以看出 Prometheus 的主要模塊包含, Server, Exporters, Pushgateway, PromQL, Alertmanager, WebUI 等。

它大致使用邏輯是這樣:
Prometheus server 定期從靜態(tài)配置的 targets 或者服務(wù)發(fā)現(xiàn)的 targets 拉取數(shù)據(jù)。
當(dāng)新拉取的數(shù)據(jù)大于配置內(nèi)存緩存區(qū)的時候,Prometheus 會將數(shù)據(jù)持久化到磁盤(如果使用 remote storage 將持久化到云端)。
Prometheus 可以配置 rules,然后定時查詢數(shù)據(jù),當(dāng)條件觸發(fā)的時候,會將 alert 推送到配置的 Alertmanager。
Alertmanager 收到警告的時候,可以根據(jù)配置,聚合,去重,降噪,最后發(fā)送警告。
可以使用 API, Prometheus Console 或者 Grafana 查詢和聚合數(shù)據(jù)。

以上內(nèi)容轉(zhuǎn)載:https://songjiayang.gitbooks.io/prometheus/content/introduction/what.html

安裝:prometheus

(1)下載安裝包https://prometheus.io/download/ 至指定目錄如/Download
shell>gwet https://github.com/prometheus/prometheus/releases/download/v2.13.1/prometheus-2.13.1.darwin-amd64.tar.gz

(2)解壓prometheus
shell>tar -xvzf ~/Download/prometheus-2.13.1.linux-amd64.tar.gz
shell>mv prometheus-2.13.1.linux-amd64 prometheus
shell>cd prometheus
shell>ls prometheus
prometheus 啟動文件
prometheus.yml 配置文件
data 存儲文件

(3)檢查prometheus版本
shell> ./prometheus version

prometheus, version 2.13.0 (branch: HEAD, revision: 6ea4252299f542669aca11860abc2192bdc7bede)
  build user:       root@f30bdad2c3fd
  build date:       20191004-11:25:34
  go version:       go1.13.1

(4)啟動prometheus server
shell> ./prometheus #正常啟動會輸出很多信息

level=info ts=2019-10-17T09:29:45.851Z caller=main.go:332 msg="Starting Prometheus" version="(version=2.13.0, branch=HEAD, revision=6ea4252299f542669aca11860abc2192bdc7bede)"

(5)查看端口監(jiān)聽,監(jiān)聽端口9090
shell>netstat -tunlp | grep prometheus
tcp6 0 0 :::9090 :::* LISTEN 31879/./prometheus

(6)通過web訪問http://IP:9090

(1)prometheus安裝部署

(7)以服務(wù)的方式啟動
shell>vim /etc/systemd/system/prometheus.service

[Unit]
Description=Prometheus Monitoring System
Documentation=Prometheus Monitoring System

[Service]
ExecStart=/Download/prometheus/prometheus \
  --config.file /Download/prometheus/prometheus.yml \
  --web.listen-address=:9090

[Install]
WantedBy=multi-user.target

shell> systemctl daemon-reload
shell> systemctl enable prometheus
shell> systemctl start prometheus

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

分享標(biāo)題:(1)prometheus安裝部署-創(chuàng)新互聯(lián)
轉(zhuǎn)載來于:http://muchs.cn/article4/csjdie.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開發(fā)、企業(yè)建站、建站公司、做網(wǎng)站、網(wǎng)站營銷、面包屑導(dǎo)航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司