服务器时钟同步服务不存在

【 使用环境 】生产环境
【 OB or 其他组件 】ob 4.3.5.2
【 使用版本 】ocp 4.3.6 Ubuntu 22.04.4
【问题描述】用的chrony时间同步,但是ocp_agent一直报错ntpq: not found,重启ocp_agent也没用,pgrep chronyd 和 chronyc sources -v都是正常的,另一个节点正常
【复现路径】问题出现前后相关操作
【附件及日志】推荐使用OceanBase敏捷诊断工具obdiag收集诊断信息,详情参见链接(右键跳转查看):

【SOP系列 22 】——故障诊断第一步(自助诊断和诊断信息收集)



【备注】基于 LLM 和开源文档 RAG 的论坛小助手已开放测试,在发帖时输入 [@论坛小助手] 即可召唤小助手,欢迎试用!

ocp上修改下clockdiff模式为2

ocp.host.check.clock-diff.mode改成2,重启ocp_agent,日志还是有2025-08-12T16:30:37.18356+08:00 ERROR [2837051,] caller=host/custom.go:328:doCollectNtpOffset: collect ntp_offset failed, command: ntpq -4pn, error: failed to execute command: Command{user=root, program=sh, outputType=std, cmd=ntpq -4pn, timeout=5s}, exitCode: 127, output: , error: sh: 1: ntpq: not found

先按照这个检查下

https://www.oceanbase.com/docs/common-ocp-1000000003340101

这个检查过了 pgrep chronyd是正常 chrony对时19ms

麻烦将上面那个日志及ocp-server.log压缩发下

HOST_LOG_host_172.14.149.35_20250812142221_20250812172221.zip (228.1 KB)

pgrep chronyd 输出结果截图发下


2025-08-12T14:26:41.82532+08:00 WARN [2013994,9658fe26514d3a70] caller=process/process.go:206:doCollect: process chronyd more than 1, use new process infos

2025-08-12T14:26:41.86066+08:00 ERROR [2013994,] caller=host/custom.go:328:doCollectNtpOffset: collect ntp_offset failed, command: ntpq -4pn, error: failed to execute command: Command{user=root, program=sh, outputType=std, cmd=ntpq -4pn, timeout=5s}, exitCode: 127, output: , error: sh: 1: ntpq: not found
: exit status 127

image

ocp-server.zip (9.2 MB)

从日志看是chronyd进程数大于1,然后去找ntp了


主进程子进程吧 另外两台 Ubuntu也是2个进程 没报错

我确认下回复您

麻烦了

我这个是非 Ubuntu系统,chronyd是只有1个进程,不清楚Ubuntu系统是否固定有两个进程,你可以找个新的Ubuntu系统按文档中的步骤装下chrony试下看看吗?

https://www.oceanbase.com/docs/common-ocp-1000000003340101

image
我发现 pgrep ntpd也有进程 但不是通过apt安装的 所以也没有ntpd命令 估计是这个引起的