5.3. 使用 Ceph Manager 模块
使用 ceph mgr module ls 命令查看可用的模块和当前启用的模块。
使用 ceph mgr module enable MODULE command 或 ceph mgr module 分别禁用 MODULE 命令或禁用模块。
如果启用了模块,则活跃的 ceph-mgr 守护进程会加载并执行它。对于提供 HTTP 服务器等服务的模块,该模块可能会在加载时发布其地址。要查看此类模块的地址,请运行 ceph mgr services 命令。
有些模块还可能实施特殊的待机模式,它在待机 ceph-mgr 守护进程和活跃的守护进程上运行。这可让提供服务的模块在客户端尝试连接到待机时将其客户端重定向到活跃的守护进程。
以下是启用仪表板模块的示例:
[ceph: root@host01 /]# ceph mgr module enable dashboard
[ceph: root@host01 /]# ceph mgr module ls
MODULE
balancer on (always on)
crash on (always on)
devicehealth on (always on)
orchestrator on (always on)
pg_autoscaler on (always on)
progress on (always on)
rbd_support on (always on)
status on (always on)
telemetry on (always on)
volumes on (always on)
cephadm on
dashboard on
iostat on
nfs on
prometheus on
restful on
alerts -
diskprediction_local -
influx -
insights -
k8sevents -
localpool -
mds_autoscaler -
mirroring -
osd_perf_query -
osd_support -
rgw -
rook -
selftest -
snap_schedule -
stats -
telegraf -
test_orchestrator -
zabbix -
[ceph: root@host01 /]# ceph mgr services
{
"dashboard": "http://myserver.com:7789/",
"restful": "https://myserver.com:8789/"
}
第一次集群启动时,它使用 mgr_initial_modules 设置来覆盖要启用的模块。但是,在集群的剩余生命周期中会忽略此设置: 仅使用它来引导。例如,在首次启动 monitor 守护进程前,您可以在 ceph.conf 文件中添加如下部分:
[mon]
mgr initial modules = dashboard balancer
如果模块实施行 hook,命令可作为常规 Ceph 命令访问,Ceph 会自动将模块命令合并到标准 CLI 接口中,并将它们正确路由到模块:
[ceph: root@host01 /]# ceph <command | help>
您可以在上述命令中使用以下配置参数:
| 配置 | 描述 | 类型 | default |
|---|---|---|---|
|
| 从中加载模块的路径。 | 字符串 |
|
|
| 加载守护进程数据的路径(如密钥环) | 字符串 |
|
|
| 监视器的 manager beacons 之间的秒数,以及其他定期检查。 | 整数 |
|
|
| 最后一次 beacon 之后的时长,管理器应被视为失败。 | 整数 |
|