欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

centos7.8如何安裝prometheus和grafana

小編給大家分享一下centos7.8如何安裝prometheus和grafana,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供南川網(wǎng)站建設(shè)、南川做網(wǎng)站、南川網(wǎng)站設(shè)計(jì)、南川網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、南川企業(yè)網(wǎng)站模板建站服務(wù),十載南川做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。

安裝準(zhǔn)備

  • 虛擬機(jī):centos7.8 2臺

本實(shí)踐中以 2臺已安裝centos7.8的虛機(jī)作為實(shí)踐環(huán)境安裝prometheus2.8.1和grafana,并在prometheus中配置對這2臺主機(jī)的監(jiān)控。

具體安裝規(guī)劃如下:

hostname

ip

os

cpu

memory

disk

備注

prometheus-host

172.22.3.148

centos7.8

2c

2g

20g

prometheus
grafana
node_exporter

prometheus-node

172.22.3.149

centos7.8

2c

2g

20g

node_exporter

  • 相關(guān)安裝文件

https://github.com/prometheus/prometheus/releases/download/v2.24.0/prometheus-2.24.0.linux-amd64.tar.gz
https://dl.grafana.com/oss/release/grafana-7.3.6-1.x86_64.rpm
https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz

備注:如無說明,以下部署均在prometheus-host部署

安裝prometheus

  • 下載

# cd /opt
# wget https://github.com/prometheus/prometheus/releases/download/v2.8.1/prometheus-2.8.1.linux-amd64.tar.gz
  • 安裝

# cd /opt
# tar -zxf prometheus-2.8.1.linux-amd64.tar.gz
# mv prometheus-2.8.1.linux-amd64 prometheus
  • 啟動

# cd /opt/prometheus
# ./prometheus
  • 創(chuàng)建service并設(shè)置自動啟動

## 創(chuàng)建service
# vi /usr/lib/systemd/system/prometheus.service
[Unit]
Description=prometheus
Documentation=https://prometheus.io/
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target

# systemctl daemon-reload
## 設(shè)置自啟動
# systemctl enable prometheus
Created symlink from /etc/systemd/system/multi-user.target.wants/prometheus.service to /usr/lib/systemd/system/prometheus.service.
## 啟動服務(wù)
# systemctl start prometheus
  • 訪問prometheus

瀏覽器地址欄輸入 http://172.22.3.148:9090

centos7.8如何安裝prometheus和grafana

安裝grafana

  • 下載

# cd /opt
# wget https://dl.grafana.com/oss/release/grafana-7.3.6-1.x86_64.rpm
  • 安裝

# cd /opt
# yum install grafana-7.3.6-1.x86_64.rpm
  • 啟動

## 安裝完成后會自動生成grafana-server的service
systemctl daemon-reload
systemctl start grafana-server
  • 設(shè)置自動啟動

## 設(shè)置自啟動
# systemctl enable grafana-server
  • 訪問grafana并配置默認(rèn)數(shù)據(jù)源

瀏覽器地址欄輸入 http://172.22.3.148:3000

centos7.8如何安裝prometheus和grafana

使用默認(rèn)用戶名密碼 admin/admin登錄

centos7.8如何安裝prometheus和grafana

首次登錄后需要設(shè)置新密碼如上。

granfa安裝后需要配置數(shù)據(jù)源

centos7.8如何安裝prometheus和grafana

選擇Prometheus,點(diǎn)擊Select

centos7.8如何安裝prometheus和grafana

只需要設(shè)置URL為http://localhost:9090

centos7.8如何安裝prometheus和grafana

其它保持默認(rèn),直接點(diǎn)“Save & Test”按鈕即可

centos7.8如何安裝prometheus和grafana

彈出保存成功提示,點(diǎn)“Back”按鈕返回。

centos7.8如何安裝prometheus和grafana

可以看到grafana已經(jīng)保存了一個數(shù)據(jù)源。

安裝node_exporter并用prometheus配置主機(jī)監(jiān)控

  • 下載

# cd /usr/local
# wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz
  • 安裝

# cd /usr/local
# tar -zxf node_exporter-1.0.1.linux-amd64.tar.gz
# mv node_exporter-1.0.1.linux-amd64/node_exporter ./bin/
  • 創(chuàng)建service并設(shè)置自動啟動

## 創(chuàng)建service
# vi /usr/lib/systemd/system/node_exporter.service
[Unit]
Description=node_exporter
Documentation=https://prometheus.io/
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/local/bin/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target

# systemctl daemon-reload
## 設(shè)置自啟動
# systemctl enable node_exporter
Created symlink from /etc/systemd/system/multi-user.target.wants/node_exporter.service to /usr/lib/systemd/system/node_exporter.service.
## 啟動服務(wù)
# systemctl start node_exporter
  • 在prometheus中配置對主機(jī)prometheus-host監(jiān)控

修改prometheus配置文件prometheus.yml,在scrape_configs下增加如下配置

- job_name: 'prometheus-host'
    file_sd_configs:
      - files: ['/opt/prometheus/sd_config/prometheus-host.yml']
        refresh_interval: 5s

新增/opt/prometheus/sd_config/prometheus-host.yml文件,內(nèi)容如下

cat /opt/prometheus/sd_config/prometheus-host.yml
- targets:
  - 172.22.3.149:9100

備注:每次修改配置完成,用promtool檢測配置文件是否正確

# /opt/prometheus/promtool check config /opt/prometheus/prometheus.yml

重啟prometheus

# systemctl restart prometheus

瀏覽器地址欄輸入 http://172.22.3.148:9090/targets

centos7.8如何安裝prometheus和grafana

可以看到targets已經(jīng)增加了對主機(jī)prometheus-host的監(jiān)控

  • 在grafana中配置面板顯示對主機(jī)prometheus-host監(jiān)控內(nèi)容

centos7.8如何安裝prometheus和grafana

點(diǎn)“+”按鈕,彈出導(dǎo)入面板窗口

centos7.8如何安裝prometheus和grafana

如圖輸入8919,點(diǎn)Load,grafana會直接從官方網(wǎng)站導(dǎo)入編號為8919的面板如下

centos7.8如何安裝prometheus和grafana

選擇數(shù)據(jù)源Prometheus,繼續(xù)“Import”,顯示node監(jiān)控界面顯示如下

centos7.8如何安裝prometheus和grafana

在prometheus-nodes安裝node_exporter并用prometheus配置主機(jī)監(jiān)控

  • 安裝步驟參考在prometheus-host安裝node_exporter步驟

  • 在prometheus中配置對主機(jī)prometheus-nodes監(jiān)控

修改prometheus配置文件prometheus.yml,在scrape_configs下增加如下配置

  - job_name: 'prometheus-nodes'
    file_sd_configs:
      - files: ['/opt/prometheus/sd_config/prometheus-nodes.yml']
        refresh_interval: 5s

新增/opt/prometheus/sd_config/prometheus-nodes.yml文件,內(nèi)容如下

cat /opt/prometheus/sd_config/prometheus-nodes.yml
- targets:
  - 172.22.3.148:9100

重啟prometheus

# systemctl restart prometheus

瀏覽器地址欄輸入 http://172.22.3.148:9090/targets

centos7.8如何安裝prometheus和grafana

可以看到targets已經(jīng)增加了對主機(jī)prometheus-nodes的監(jiān)控

訪問grafana,也可以看到node監(jiān)控界面多了prometheus-nodes的顯示

centos7.8如何安裝prometheus和grafana

以上是“centos7.8如何安裝prometheus和grafana”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

分享題目:centos7.8如何安裝prometheus和grafana
轉(zhuǎn)載源于:http://aaarwkj.com/article26/psoijg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google網(wǎng)站建設(shè)、動態(tài)網(wǎng)站虛擬主機(jī)、定制開發(fā)、網(wǎng)站制作

廣告

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

網(wǎng)站優(yōu)化排名
朋友的尤物人妻中文字幕| 91精品超碰人人在线公开| 97视频高清在线观看| 宅男午夜一区二区三区| 日本韩国欧美一区在线| 欧美日韩国产亚洲免费| 日韩有码中文字幕一区| 91在线视频欧美国产| 国产精品无遮挡猛进猛出| 久久偷拍一区二区三区| 国产大片久久午夜电影| 亚洲av资源一区二区| 亚洲一区二区三区伊人| 日本韩国一区二区精品| 高清不卡一区二区在线观看| 国产成人精品一区二区国产乱码 | 国产午夜视频成人无遮挡| 色噜噜男人的天堂av| 日本东京热免费一二三区| 欧美日韩国产综合在线观看| 久久99久久精品视频国产| 亚洲丰满毛茸茸毛茸茸| 欧美一区二区三区亚洲| 日韩成人手机视频在线观看| 日韩三级黄片在线观看| 亚洲熟妇av一区二区| 亚洲欧美日韩综合久久| 亚洲精品日韩一区二区| 一区二区亚洲国产精品| 亚洲高清有码在线观看| 五月婷婷六月丁香综合激情| 毛片91成人在线播放| 久久人妻制服乱码中文字幕| 深夜av免费在线观看| 中文字幕乱码av一区二区| 亚洲av欧美日韩国产| 欧美日韩激情在线一区| 国产第一页第二页在线| 免费看真人性生活视频| 欧美日韩免费一区二三区| 亚洲综合久久国产一区二区|