当前位置: 代码迷 >> 综合 >> ⑤ Ceph Dashboard界面介绍与安装
  详细解决方案

⑤ Ceph Dashboard界面介绍与安装

热度:43   发布时间:2023-10-31 09:41:08.0

文章目录

  • Ceph Dashboard介绍
  • 配置Ceph Dashboard
  • 修改默认配置命令
  • 开启Object Gateway管理功能

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 -y
2、开启mgr功能
ceph mgr module enable dashboard
3、生成并安装自签名的证书
ceph dashboard create-self-signed-cert  
4、创建一个dashboard登录用户名密码
ceph dashboard ac-user-create guest 123456 administrator 
5、查看服务访问方式
ceph mgr services
"dashboard": "https://cephnode03:8443/"

提醒:目前 mgr 功能模块可能还存在选举问题,如果多mgr 节点都开启,可能会出现web页面取不到数据,建议只开启一个mgr节点服务,然后关闭其他节点mgr服务。

#报错查看
[root@cephnode01 ~]# ceph -scluster:id:     24b31689-d39b-4a1a-97a5-20c8b81607f3health: HEALTH_ERRModule 'dashboard' has failed: IOError("Port 8443 not free on 'cephnode03'",)  #这行为报错信息services:mon: 3 daemons, quorum cephnode01,cephnode02,cephnode03 (age 2m)mgr: cephnode01(active, since 29s), standbys: cephnode03, cephnode02mds:  3 up:standbyosd: 9 osds: 9 up (since 2m), 9 in (since 7d)rgw: 1 daemon active (cephnode01)data:pools:   8 pools, 640 pgsobjects: 1.53k objects, 9.9 GiBusage:   39 GiB used, 561 GiB / 600 GiB availpgs:     640 active+clean#报错意思是cephnode03节点上的8443端口被占用导致dashboard模块失败 查看配置
[root@cephnode01 ~]# ceph config dump
WHO   MASK LEVEL    OPTION                    VALUE      RO mgr      advanced mgr/dashboard/server_addr 10.0.0.108 *  mgr      advanced mgr/dashboard/server_port 7000       * [root@cephnode01 ~]# ceph mgr services
{"dashboard": "https://cephnode03:8443/"
}#注意ceph -s显示当前活跃的mgr是cephnode01
#尝试把dashboard修改到cephnode01节点上
ceph config set mgr mgr/dashboard/server_addr cephnode01
ceph mgr module disable dashboard
ceph mgr module enable dashboard --force#查看现在的状态,集群恢复正常
[root@cephnode01 ~]# ceph config dump  
WHO   MASK LEVEL    OPTION                    VALUE      RO mgr      advanced mgr/dashboard/server_addr cephnode01 *  mgr      advanced mgr/dashboard/server_port 7000       * 
[root@cephnode01 ~]# ceph mgr services
{"dashboard": "https://cephnode01:8443/"
}
[root@cephnode01 ~]# ceph -scluster:id:     24b31689-d39b-4a1a-97a5-20c8b81607f3health: HEALTH_OKservices:mon: 3 daemons, quorum cephnode01,cephnode02,cephnode03 (age 72m)mgr: cephnode01(active, since 69m), standbys: cephnode02, cephnode03mds:  3 up:standbyosd: 9 osds: 9 up (since 72m), 9 in (since 7d)rgw: 1 daemon active (cephnode01)data:pools:   8 pools, 640 pgsobjects: 1.65k objects, 10 GiBusage:   40 GiB used, 560 GiB / 600 GiB availpgs:     640 active+clean

修改默认配置命令

#指定集群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
radosgw-admin user info --uid=user01"user": "user01","access_key": "QJ5763QEN0B26I7RA0PM","secret_key": "NmWIxRrht8n6il9qUMT53m2RDYfXfZibdD2tUKJw"
#2、提供Dashboard证书
ceph dashboard set-rgw-api-access-key QJ5763QEN0B26I7RA0PM
ceph dashboard set-rgw-api-secret-key NmWIxRrht8n6il9qUMT53m2RDYfXfZibdD2tUKJw
#3、配置rgw主机名和端口
ceph dashboard set-rgw-api-host 192.168.0.6
ceph dashboard set-rgw-api-port 7480
4、刷新web页面