亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

prometheus監控docker

發布時間:2020-06-24 06:10:57 來源:網絡 閱讀:1589 作者:hagretd 欄目:云計算

????????Prometheus是一個開源系統監控和警報工具包。可以將Docker配置為Prometheus目標目前,您只能監控Docker本身。您目前無法使用Docker目標監控應用程序。


監控docker的操作步驟:

1.使用docker的metrics-address向Prometheus暴露監控端口:

修改docker的daemon.json文件

{
??????"metrics-addr":?"192.168.191.18:9323",??#docker官網上的配置是127.0.0.1:9323在Prometheus無法連接該ip,手動執行curl?-L?127.0.0.1:9323時可以顯示docker的監控指標的,可能由于容器之間的隔離原因無法連接吧。
?????“experimental":?true
}

之后容器docker服務:systemctl restart docker

2.編輯Prometheus.yml

#?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).
??#?Attach?these?labels?to?any?time?series?or?alerts?when?communicating?with
??#?external?systems?(federation,?remote?storage,?Alertmanager).
??external_labels:
??????monitor:?'codelab-monitor'
#?Load?rules?once?and?periodically?evaluate?them?according?to?the?global?'evaluation_interval'.
rule_files:
??#?-?"first.rules"
??#?-?"second.rules"
#?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:?['localhost:9090']
??-?job_name:?'docker'
?????????#?metrics_path?defaults?to?'/metrics'
?????????#?scheme?defaults?to?'http'.
????static_configs:
??????-?targets:?['192.168.191.18:9323']

3.啟動一個Prometheus的容器

????docker環境使用的時swarm集群方式創建服務的命令方式不一樣。swarm集群部署可自行操作

[root@docker?~]#?docker?service?create?--replicas?1?--name?my-prometheus??--mount?type=bind,source=/root/prometheus.yml,destination=/etc/prometheus/prometheus.yml?
--publish?published=9090,target=9090,protocol=tcp?????prom/prometheus
rgkmwhwqepl1qivlpq8r3nt2n
overall?progress:?1?out?of?1?tasks?
1/1:?running???[==================================================>]?
verify:?Service?converged

查看創建的服務信息

[root@docker?~]#?docker?service??ls?
ID??????????????????NAME????????????????MODE????????????????REPLICAS????????????IMAGE????????????????????PORTS
rgkmwhwqepl1????????my-prometheus???????replicated??????????1/1?????????????????prom/prometheus:latest???*:9090->9090/tcp

查看服務的具體信息

[root@docker?~]#?docker?service?ps??my-prometheus
ID??????????????????NAME????????????????IMAGE????????????????????NODE????????????????DESIRED?STATE???????CURRENT?STATE????????????ERROR???????????????PORTS
y8akc5dmwjrn????????my-prometheus.1?????prom/prometheus:latest???docker??????????????Running?????????????Running?16?minutes?ago

? ? ? ? ? ? ? ? ? ?

4.訪問Prometheus的頁面查看監控值

prometheus監控docker

監控項的查看

prometheus監控docker



prometheus監控docker的基本內容已經部署及驗證完成,docke官網有關Prometheus·監控docker的配置實驗在查看Prometheus的監控target時報錯:dial tcp xxxx: connect: connection refused。

docker官網https://docs.docker.com/config/thirdparty/prometheus/

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

吉木萨尔县| 白沙| 武邑县| 沈丘县| 扶绥县| 南乐县| 正阳县| 海伦市| 乌兰县| 定陶县| 潍坊市| 旌德县| 贡嘎县| 兖州市| 敖汉旗| 鄂州市| 西和县| 临汾市| 田林县| 秀山| 彩票| 临澧县| 九寨沟县| 沧源| 陕西省| 申扎县| 慈利县| 政和县| 东丰县| 稷山县| 永昌县| 榆中县| 堆龙德庆县| 阿瓦提县| 普定县| 彭山县| 肥城市| 密山市| 天津市| 南溪县| 仪征市|