Ceph Dashboard
启用 dashboard module
# 启用
# ceph mgr module enable dashboard
# 验证是否启用
# ceph mgr module ls
{
"enabled_modules": [
"balancer",
"crash",
"dashboard", # 已启用
"iostat",
"restful",
"status"
],
...http dashboard
- 若使用http协议的Dashboard V2,需要设定禁用SSL功能:
# ceph config set mgr mgr/dashboard/ssl falsehttps dashboard
若使用https协议的Dashboard V2,需要以如下步骤生成证书及相关配置:
-
Dashboard要通过https协议提供服务。管理员可配置其使用自动生成的自签证书,也可以为其提供自定义的证书文件,⼆者选其⼀即可。
-
若需要使用自签证书,运行如下命令生成自动生成证书即可:
-
# ceph dashboard create-self-signed-cert -
若需要自定义证书,则应该通过合适的方式获取到相关证书。例如,以如下方式运行命令生成自定义的证书:
-
# openssl req -new -nodes -x509 -subj "/O=IT/CN=ceph-mgr-dashboard" \ -days 3650 -keyout dashboard.key -out dashboard.crt -extensions v3_ca
-
-
而后配置dashboard加载证书:
# ceph config-key set mgr mgr/dashboard/crt -i dashboard.crt
# ceph config-key set mgr mgr/dashboard/key -i dashboard.key配置监听的地址和端口
# ceph config set mgr mgr/dashboard/server_addr 0.0.0.0
# ceph config set mgr mgr/dashboard/server_port 8888- 也可以分别为每个mgr实例配置监听的地址和端口,将下面命令格式中的$name替换为mgr实例的名称即可。
# ceph config set mgr mgr/dashboard/$name/server_addr $IP
# ceph config set mgr mgr/dashboard/$name/server_port $PORT启用与禁用 Dashboard
- 重新启用dashboard后配监听的地址和端口等配置才会生效
# ceph mgr module disable dashboard
# ceph mgr module enable dashboard配置管理员认证信息
ceph dashboard set-login-credentials <username> <password>
# admin设置密码为12345
# ceph dashboard set-login-credentials admin 12345
Username and password updated验证
# ceph -s
cluster:
id: 23af67b8-235b-48f2-8dfe-8b52370a7419
health: HEALTH_OK
services:
mon: 3 daemons, quorum stor01,stor02,stor03
mgr: stor02(active), standbys: stor01 # 浏览器访问处于active的mgr节点
mds: cephfs-1/1/1 up {0=stor01=up:active}
osd: 3 osds: 3 up, 3 in
rgw: 1 daemon active
...
# 浏览器访问,登录账号为admin,密码为12345
# http://10.0.0.17:8888/#/login