Ceph-Dash 是用 Python 开发的一个 Ceph 的监控面板,用来监控 Ceph 的运行状态。同时 提供 REST API 来访问状态数据。
一、查看 Ceph 模块
Ceph mgr 是一个多模块化的组件,其组件可以单独的启用或关闭。
其操作在 ceph-deploy 服务器操作。
[ceph@ceph-deploy ceph-cluster]$ ceph mgr module ls # 列出 ceph 所有模块
二、启用 dashboard 模块
注意事项:模块启用后还不能直接访问,需要配置关闭 SSL 或启用 SSL 及指定监听地址。
Ceph dashboard 模块在 mgr 节点进行开启设置,并且配置关闭 SSL
# 启用模块
[ceph@ceph-deploy ceph-cluster]$ ceph mgr module enable dashboard
# 关闭 dashboard SSL 功能
[ceph@ceph-deploy ceph-cluster]$ ceph config set mgr mgr/dashboard/ssl false
# 指定 dashboard 监听地址
[ceph@ceph-deploy ceph-cluster]$ ceph config set mgr mgr/dashboard/ceph-mgr1/server_addr 10.0.0.17
# 指定 dashboard 监听端口
[ceph@ceph-deploy ceph-cluster]$ ceph config set mgr mgr/dashboard/ceph-mgr1/server_port 9009
# 验证 ceph 集群状态
[ceph@ceph-deploy ceph-cluster]$ ceph -s
cluster:
id: 245d70b6-c729-447a-b336-9f428a358eec
health: HEALTH_WARN
clock skew detected on mon.ceph-mon2, mon.ceph-mon3
services:
mon: 3 daemons, quorum ceph-mon1,ceph-mon2,ceph-mon3
mgr: ceph-mgr1(active), standbys: ceph-mgr2
mds: mycephfs-2/2/2 up {0=ceph-mon2=up:active,1=ceph-mgr1=up:active}, 2 up:standby-replay
osd: 9 osds: 9 up, 9 in
rgw: 2 daemons active
data:
pools: 9 pools, 240 pgs
objects: 336 objects, 183 MiB
usage: 9.6 GiB used, 890 GiB / 900 GiB avail
pgs: 240 active+clean
io:
client: 30 KiB/s rd, 0 B/s wr, 31 op/s rd, 19 op/s wr
如果有以下报错:
Module 'dashboard' has failed: error('No socket could be created',)
需要检查 mgr 服务是否正常运行,可以重启一遍 mgr 服务
三、在 mgr 节点验证端口与进程
[root@ceph-mgr1 ~]# lsof -i:9009
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ceph-mgr 3846 ceph 28u IPv4 32351 0t0 TCP ceph-mgr1.lck.local:pichat (LISTEN)
四、dashboard 访问验证
五、设置 dashboard 账户及密码
# 设置 lck 用户密码为 123456
[ceph@ceph-deploy ceph-cluster]$ ceph dashboard set-login-credentials lck 123456
Username and password updated
六、dashboard 界面
登陆成功界面
Ceph 集群信息
pool信息
Ceph RBD 状态
CephFS 状态
七、dashboard SSL
如果要使用 SSL 访问。则需要配置签名证书。证书可以使用 ceph 命令生成,或是 opessl 命令生成。
7.1 ceph 自签名证书
# 未启用 SSL ,查看当前 dashboard 访问 URL
[ceph@ceph-deploy ceph-cluster]$ ceph mgr services
{
"dashboard": "http://10.0.0.17:9009/"
}
# 生成证书
[ceph@ceph-deploy ceph-cluster]$ ceph dashboard create-self-signed-cert
# 启用 SSL
[ceph@ceph-deploy ceph-cluster]$ ceph config set mgr mgr/dashboard/ssl true
# 重启 mgr 服务
[root@ceph-mgr1 ~]# systemctl restart ceph-mgr@ceph-mgr1
# 启用 SSL ,查看当前 dashboard 访问 URL
[ceph@ceph-deploy ceph-cluster]$ ceph mgr services
{
"dashboard": "https://10.0.0.17:9009/"
}
7.2 访问 dashboard