

下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Prometheus CephPrometheus Server創(chuàng)建運(yùn)Prometheus Server進(jìn)程的系統(tǒng),并為其創(chuàng)建家錄/var/lib/prometheus作為數(shù)據(jù) 錄。# useradd -r -m -d /var/lib/prometheus prometheus #并安裝Prometheus Server,以2.7.2版為例: # wget /prometheus/prometheu s/releases/download/v2.7.2/prometheus-2.7.2.linux-amd64.tar.gz # tar xf prometheus-2.7.2.linux- a
2、md64.tar.gz -C /usr/local/# ln /usr/local/prometheus-2.7.2.linux-amd64 /usr/local/prometheus創(chuàng)建Unit File 創(chuàng)建Prometheus專的Unit File,件路徑為/usr/lib/systemd/system/prometheus.serviceUnitDescription=The Prometheus 2 monitoring system and time series database. ation=After=network.ServiceEnvironmentFile=-/etc/
3、sysconfig/prometheus Us rometheus ExecStart=/usr/local/prometheus/prometheus -storage.tsdb.path=/var/lib/prometheus -config.file=/usr/local/prometheus/prometheus.yml -web.listen-address=:9090 -web.external-url= Restart=on-failure StartLimit erval=1 RestartSec=3Install WantedBy=multi-user.4. 編輯配置件 Pr
4、ometheus的主配置件為prometheus.yml,它主要由global、rule_les、 scr _congs、alerting、remote_write和remote_read個(gè)配置段組成:global:全局配置段;scr _congs:scr 配置集合,于定義 的標(biāo)對(duì)象( )的集合,以及描述如何抓取(scr )相關(guān)指標(biāo)數(shù)據(jù)的配置參數(shù);通常,每個(gè)scr 配置對(duì)應(yīng)于個(gè)單獨(dú)的作業(yè)(job),每個(gè)s可通過靜態(tài)配置(s ic_congs)直接給出定義,也可基于Prometheus持的服務(wù)發(fā)現(xiàn)機(jī)制進(jìn)動(dòng)配置;alertmanager_congs:可由Prometheus使的Alertmanag
5、er實(shí)例的集合,以及如何同這些 Alertmanager交互的配置參數(shù);每個(gè)Alertmanager可通過靜態(tài)配置(s ic_congs)直接給出定義,也可基于Prometheus 的服務(wù)發(fā)現(xiàn)機(jī)制進(jìn)動(dòng)配置;remote_write:配置“ 寫”機(jī)制,Prometheus需要將數(shù)據(jù)保存于外部的 系統(tǒng)(例如InuxDB)時(shí)定義此配置段,隨后Prometheus將樣本數(shù)據(jù)通過HTTP協(xié)議發(fā)送給由URL指定適配器(Adaptor);remote_read:配置“ 讀”機(jī)制,Prometheus到的查詢請(qǐng)求交給由URL指定適配器( ater)執(zhí),Adapter將請(qǐng)求條件轉(zhuǎn)換為 Prometheus可的格
6、式;配置件組成格式及常的全局配置參數(shù)如下所:服務(wù)中的查詢請(qǐng)求,并將獲取的響應(yīng)數(shù)據(jù)轉(zhuǎn)換為global:# How frequently to scrs by default. scr _ erval: | default = 1m # How long until a scr request times out. scr _timeout: | default = 10s # How frequently to evaluate rules. evaluation_ erval: | default = 1m # The labels to add to any time series or a
7、lerts when communicating with # external systems (federation, remote storage, Alertmanager). external_labels: : . # Rule files specifies a list of globs. Rules and alerts are read from # all matching files.rule_files: - . # A list of scr configurations. scr _configs: - . # Alerting specifies setting
8、s related to the Alertmanager. alerting:alert_relabel_configs: - . alertmanagers: - . # Settings related to the remote write feature. remote_write: - . # Settings related to the remote read feature. remote_read: - . scr 配置段中,使s ic_congs配置Job的語法格式:# Thes specified by the s ic config.s: - # Labels ass
9、igned to all metrics scr d from the labels: : . s.使le_sd_congs配置Job的語法格式:s: , . ,labels: : , .,.配置件中的默認(rèn)配置僅持以靜態(tài)式通過node_exporter Prometheus Server本機(jī)的系統(tǒng)指標(biāo),其配置如下所。scr _configs:- job_name: prometheus# metrics_path defaults to /metrics # scheme defaults to http.s ic_configs:-s: localhost:90905. 啟動(dòng)服務(wù) # sys
10、temctl daemon-reload # systemctl start prometheus.service 6.node_exporter安裝程序包 # wget /prometheus/node exporter/releases/download/v0.17.0/node exporter-0.17.0.linux-amd64.tar.gz # tar xf node_exporter-0.17.0.linux-amd64.tar.gz -C /usr/local/ # ln -sv /usr/local/node_exporter-0.17.0.linux-amd64 /usr/
11、local/node_exporter #創(chuàng)建運(yùn)Prometheus Server進(jìn)程的系統(tǒng),并為其創(chuàng)建家錄/var/lib/prometheus作為數(shù)據(jù) 錄。# useradd -r -m -d /var/lib/prometheus prometheus #創(chuàng)建Unit File件路徑為/usr/lib/systemd/system/node_exporter.serviceUnitDescription=Prometheus exporter for machine metrics, written in Go with pluggable metric collectors.ation
12、= After=network./prometheus/node_exporterServiceEnvironmentFile=-/etc/sysconfig/node_exporter UsrometheusExecStart=/usr/local/node_exporter/node_exporter $NODE_EXPORTER_OPTSRestart=on-failure StartLimit erval=1 RestartSec=3Install WantedBy=multi-user.4. 啟動(dòng)服務(wù) # systemctl daemon-reload # systemctl sta
13、rt node_exporter.service # systemctl enable node_exporter.service設(shè)定Ceph MgrCeph Manager內(nèi)置了眾多模塊,包括prometheus模塊,于直接輸出Prometheus格的指標(biāo)數(shù)據(jù)。# ceph mgr module enable prometheus Prometheus模塊默認(rèn) 于TCP協(xié)議的9283端。配置Prometheus Job修改Prometheus的配置件,添加與Ceph相關(guān)的Job。scr _configs:# The job name is added as a label job= to any timeseries scr d from this config.- job_name: prometheus# metrics_path default
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度景區(qū)景點(diǎn)精細(xì)化保潔服務(wù)協(xié)議
- 二零二五年度二手車轉(zhuǎn)讓及過戶手續(xù)協(xié)議
- 二零二五年度新型小區(qū)門衛(wèi)管理及應(yīng)急預(yù)案合同
- 2025年度綠色節(jié)能庫房租賃合同
- 2025年度高新技術(shù)企業(yè)員工勞動(dòng)合同解除終止協(xié)議書
- 2025年度物業(yè)服務(wù)合同主體變更協(xié)議范本
- 二零二五年度大數(shù)據(jù)服務(wù)股權(quán)投資與轉(zhuǎn)讓協(xié)議
- 二零二五年度冷凍庫租賃及冷鏈物流配送中心建設(shè)合同
- 二零二五年度離婚協(xié)議中財(cái)產(chǎn)分割執(zhí)行監(jiān)督補(bǔ)充協(xié)議
- 蘇武牧羊傳紅色故事觀后感
- 汽車修理常用配件信息公示
- 同濟(jì)大學(xué)信紙
- 門式鋼架廠房設(shè)計(jì)
- 口腔模型的灌制-醫(yī)學(xué)課件
- 煤礦班組建設(shè)實(shí)施方案
- (完整word版)新《中華頌》朗誦稿
- 糖尿病健康教育及飲食指導(dǎo)
- PFMEA模板完整版文檔
- 三無曲線(有緩)繩正法撥道自動(dòng)計(jì)算表
- 教學(xué)能力比賽決賽 《英語》教案
- 《母雞》課件 王崧舟 千課萬人 (圖片版不可編輯)
評(píng)論
0/150
提交評(píng)論