注意

本文档适用于 Ceph 的开发版本。

CLI API 命令模块

CLI API 模块通过 CLI 命令暴露了大部分 ceph-mgr Python API。这个 API 可以进行基准测试。

启用

通过运行以下命令启用 cli api 模块

ceph mgr module enable cli_api

通过运行以下命令确保 cli api 模块已启用

ceph mgr module ls | grep cli_api

用法

这是 Manager CLI 命令的一般形式

ceph mgr cli <command> <param>

通过运行以下命令打印服务器列表

ceph mgr cli list_servers

通过运行以下命令列出所有可用的 Manager 模块命令

ceph mgr cli --help

通过运行以下形式的命令来对命令进行基准测试

ceph mgr cli_benchmark <number of calls> <number of threads> <command> <param>

例如,运行以下命令来对获取 osd_map 的命令进行基准测试

ceph mgr cli_benchmark 100 10 get osd_map

由 Ceph 基金会为您呈现

Ceph 文档是由非营利性 Ceph 基金会 资助和托管的社区资源。如果您希望支持这项工作和我们的其他努力,请考虑 立即加入