1.6. 在运行时设置特定配置
有两种常规方法来设置运行时配置:
- 使用 Ceph 监控器
- 使用管理套接字
您可以使用 tell 和 injectargs 命令联系 monitor 来设置 Ceph 运行时配置设置。要使用这个方法,您要修改的监控器和守护进程必须正在运行:
ceph tell {daemon-type}.{daemon id or *} injectargs --{name} {value} [--{name} {value}]
ceph tell {daemon-type}.{daemon id or *} injectargs --{name} {value} [--{name} {value}]
将 {daemon-type} 替换为 osd 或 mon 之一。您可以使用 * 将运行时设置应用到特定类型的所有守护进程,或者指定特定守护进程的 ID(即号码或名称)。例如,要将名为 osd.0 的 ceph-osd 守护进程的调试日志记录更改为 0/5,请执行以下命令:
ceph tell osd.0 injectargs '--debug-osd 0/5'
ceph tell osd.0 injectargs '--debug-osd 0/5'
tell 命令有多个参数,因此 tell 的每个参数都必须用单引号括起来,且配置前带有两个短划线 ('--{config_opt} {opt-val}' ['-{config_opt} {opt-val}'])。守护进程 命令不需要引号,因为它仅使用一个参数。
ceph tell 命令进入 monitor。如果您无法绑定到监控器,您仍然可以进行改变,登陆到需要修改配置的守护进程所在的主机,ceph daemon 进行修改。例如:
sudo ceph osd.0 config set debug_osd 0/5
sudo ceph osd.0 config set debug_osd 0/5