Ceph Dashboard Promethus+Grafana監控


Ceph Dashboard介紹

Ceph 的監控可視化界面方案很多----grafana、Kraken。但是從Luminous開始,Ceph 提供了原生的Dashboard功能,通過Dashboard可以獲取Ceph集群的各種基本狀態信息。 mimic版 (nautilus版) dashboard 安裝。如果是 (nautilus版) 需要安裝 ceph-mgr-dashboard

配置Ceph Dashboard

1、在每個mgr節點安裝
# yum install ceph-mgr-dashboard 
2、開啟mgr功能
# ceph mgr module enable dashboard
3、生成並安裝自簽名的證書
# ceph dashboard create-self-signed-cert  
4、創建一個dashboard登錄用戶名密碼
# ceph dashboard set-login-credentials admin admin 
5、查看服務訪問方式
# ceph mgr services

修改默認配置命令
指定集群dashboard的訪問端口
# ceph config-key set mgr/dashboard/server_port 7000
指定集群 dashboard的訪問IP
# ceph config-key set mgr/dashboard/server_addr $IP 
開啟Object Gateway管理功能
1、創建rgw用戶
# radosgw-admin user create --uid=user01 --display-name=user01 --system
2、提供Dashboard證書
# ceph dashboard set-rgw-api-access-key $access_key
# ceph dashboard set-rgw-api-secret-key $secret_key
3、配置rgw主機名和端口
# ceph dashboard set-rgw-api-host 192.168.0.246
# ceph dashboard set-rgw-api-port 7480
4、刷新web頁面

安裝grafana

1、配置yum源文件
# vim /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

2.通過yum命令安裝grafana
# yum -y install grafana

3.啟動grafana並設為開機自啟
# systemctl start grafana-server.service 
# systemctl enable grafana-server.service

安裝promethus

1、下載安裝包,下載地址
https://prometheus.io/download/
2、解壓壓縮包
# tar fvxz prometheus-2.14.0.linux-amd64.tar.gz
3、將解壓后的目錄改名
# mv prometheus-2.14.0.linux-amd64 /opt/prometheus
4、查看promethus版本
# /opt/prometheus/prometheus --version
5、配置系統服務啟動
# vim /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus Monitoring System
Documentation=Prometheus Monitoring System

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

[Install]
WantedBy=multi-user.target
6、加載系統服務
# systemctl daemon-reload
7、啟動服務和添加開機自啟動
# systemctl start prometheus
# systemctl enable prometheus

ceph mgr prometheus插件配置

# ceph mgr module enable prometheus
# netstat -nltp | grep mgr 檢查端口
# curl 127.0.0.1:9283/metrics  測試返回值

配置promethus

在 scrape_configs: 配置項下添加
vim /opt/prometheus/prometheus.yml
- job_name: 'ceph_cluster'
    honor_labels: true
    scrape_interval: 5s
    static_configs:
      - targets: ['192.168.0.246:9283']
        labels:
          instance: ceph

重啟promethus服務
# systemctl restart prometheus

檢查prometheus服務器中是否添加成功

配置grafana
1、瀏覽器登錄 grafana 管理界面  
2、添加data sources,點擊configuration--》data sources 3、添加dashboard,點擊HOME--》find dashboard on grafana.com 4、搜索ceph的dashboard 5、點擊HOME--》Import dashboard, 選擇合適的dashboard,記錄編號
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM