Ceph 的監控可視化界面方案不少----grafana、Kraken。可是從Luminous開始,Ceph 提供了原生的Dashboard功能,經過Dashboard能夠獲取Ceph集羣的各類基本狀態信息。 mimic版 (nautilus版) dashboard 安裝。若是是 (nautilus版) 須要安裝 ceph-mgr-dashboardhtml
一、在每一個mgr節點安裝 # yum install ceph-mgr-dashboard 二、開啓mgr功能 # ceph mgr module enable dashboard 三、生成並安裝自簽名的證書 # ceph dashboard create-self-signed-cert 四、建立一個dashboard登陸用戶名密碼 # ceph dashboard ac-user-create guest 1q2w3e4r administrator 五、查看服務訪問方式 # ceph mgr services
配置好以後就能夠登陸,頁面以下:linux
<img src="https://raw.githubusercontent.com/PassZhang/passzhang.github.io/images-picgo/20200101134137.png" alt="登陸界面" style="zoom: 80%;" />git
<img src="https://raw.githubusercontent.com/PassZhang/passzhang.github.io/images-picgo/20200101134252.png" alt="主界面" style="zoom:80%;" />github
<img src="https://raw.githubusercontent.com/PassZhang/passzhang.github.io/images-picgo/20200101134441.png" style="zoom:80%;" />web
指定集羣dashboard的訪問端口 # ceph config-key set mgr/dashboard/server_port 7000 指定集羣 dashboard的訪問IP # ceph config-key set mgr/dashboard/server_addr $IP
一、建立rgw用戶 # radosgw-admin user info --uid=user01 二、提供Dashboard證書 # ceph dashboard set-rgw-api-access-key $access_key # ceph dashboard set-rgw-api-secret-key $secret_key 三、配置rgw主機名和端口 # ceph dashboard set-rgw-api-host 192.168.25.224 四、刷新web頁面
一、配置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
一、下載安裝包,下載地址 https://prometheus.io/download/ 二、解壓壓縮包 # tar fvxz prometheus-2.14.0.linux-amd64.tar.gz 三、將解壓後的目錄更名 # mv prometheus-2.13.1.linux-amd64 /opt/prometheus 四、查看promethus版本 # ./prometheus --version 五、配置系統服務啓動 # 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 六、加載系統服務 # systemctl daemon-reload 七、啓動服務和添加開機自啓動 # systemctl start prometheus # systemctl enable prometheus
# ceph mgr module enable prometheus # netstat -nltp | grep mgr 檢查端口 # curl 127.0.0.1:9283/metrics 測試返回值
一、在 scrape_configs: 配置項下添加vim
vim prometheus.yml - job_name: 'ceph_cluster' honor_labels: true scrape_interval: 5s static_configs: - targets: ['192.168.25.224:9283'] labels: instance: ceph
二、重啓promethus服務api
# systemctl restart prometheus
三、檢查prometheus服務器中是否添加成功瀏覽器
# 瀏覽器-》 http://x.x.x.x:9090 -》status -》Targets
一、瀏覽器登陸 grafana 管理界面
二、添加data sources,點擊configuration--》data sources
三、添加dashboard,點擊HOME--》find dashboard on grafana.com
四、搜索ceph的dashboard
五、點擊HOME--》Import dashboard, 選擇合適的dashboard,記錄編號服務器
原文出處:https://www.cnblogs.com/passzhang/p/12179816.htmlcurl