OCP 健康巡检报告里出现 SSH 延迟、时钟偏移巡检结果异常,如下图所示。

详细说明
OCP 健康巡检报告里出现 SSH 延迟、时钟偏移存在两种原因不同的情况,建议按以下方法进行排查。
SSH 延迟。
OCP.log 相关日志信息如下。
2022-12-01 18:26:33.123 WARN 56723 --- [http-nio-8080-exec-20,xxxxx,xxxxx] c.xxxxxx.ocp.common.util.ssh.JSchUtils : SSH connect failed: root@14.0.0.158:22., error message Auth fail.2022-12-01 18:26:33.131 ERROR 56723 --- [http-nio-8080-exec-20,xxxxx,xxxxx] c.a.o.s.o.healthcheck.metrics.HostTime : Health check error: 100.xxx.xxx.123根据上面这段日志展开确认用户凭据存在问题,查询 ocp_meta 租户 OCP 数据库
profile_credential_access,进一步确认凭据与专有云底座凭据表结果不一致。select * from profile_credential a join profile_credential_access b on b.credential_id = a.id join compute_host c on c.id = b.target_id where access_target = 'HOST' and inner_ip_address = 'xxx.xxx.xxx.xxx' \G时钟偏移。
一般这种情况,原因可能为 OCP 容器里的 admin 用户无 sudo 权限。
日志相关信息检索,命令如下。
grep 'Clock-diff failed' ocp.log -A 50解决 admin 用户无 sudo 权限。
sed -i 's/^admin.*ALL=(ALL).*ALL/admin ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers
最终确认到专有云底座上主机密码是不定期修改的,调整凭据后该问题解决。
适用版本
OCP 所有版本。