OCP4.4.0启动失败 ocp-server报错Caused by:sqlStatContextServiceImpl

问题

准生产OCP重启失败,OBD重试多次启动ocp-server失败, 版本号: 4.4.0-20251114143405

OCP主机系统版本,el8,AlmaLinux release 8.10 (Cerulean Leopard)
从低版本OCP4.3.6升级而来,用的ocp-all-in-one-4.4.0-20251114143405.el7.x86_64.tar.gz,升级好后几天重启是正常,昨天下午OCP启动失败,有做过变动

OBD启动OCP日志

obd cluster start myocp
Get local repositories ok
Load cluster param plugin ok
Cluster status check ok
Check before start ocp-server-ce ok
Start ocp-server-ce ok
[ERROR] failed to start xxxxx.0.43 ocp-server-ce
Trace ID: ea67d2ca-c99f-11f0-88d8-00163e61ea7c
If you want to view detailed obd logs, please run: obd display-trace ea67d2ca-c99f-11f0-88d8-00163e61ea7c

obd.txt (88.6 KB)

obd启动ocp短暂期间,看ocp_meta租户有相应ocp-server的连接,过后ocp-server的连接都断开

obclient -hxxxxx.3.138 -P2881 -uroot@ocp_meta -p  -A -Dmeta_database -e"show processlist"
Enter password: 
+------------+------+-------------------+---------------+---------+------+--------+------------------+
| Id         | User | Host              | db            | Command | Time | State  | Info             |
+------------+------+-------------------+---------------+---------+------+--------+------------------+
| 3221641345 | root | xxxxx.0.43:50178 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
| 3221641358 | root | xxxxx.0.43:50234 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
| 3221641331 | root | xxxxx.0.43:50236 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
| 3221641365 | root | xxxxx.0.43:50154 | meta_database | Sleep   |    3 | SLEEP  | NULL             |
| 3221641335 | root | xxxxx.0.43:50164 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
| 3221599521 | root | xxxxx.0.43:56986 | oceanbase     | Sleep   |   10 | SLEEP  | NULL             |
| 3221640571 | root | xxxxx.0.43:50256 | meta_database | Query   |    0 | ACTIVE | show processlist |
| 3221641356 | root | xxxxx.0.43:50246 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
| 3221641348 | root | xxxxx.0.43:50206 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
| 3221641363 | root | xxxxx.0.43:50184 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
| 3221641309 | root | xxxxx.0.43:57294 | meta_database | Sleep   |   15 | SLEEP  | NULL             |
| 3221641362 | root | xxxxx.0.43:50218 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
| 3221641334 | root | xxxxx.0.43:50200 | meta_database | Sleep   |    5 | SLEEP  | NULL             |
+------------+------+-------------------+---------------+---------+------+--------+------------------+

ocp-server日志

egrep 'Caused by' ocp-server.log
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'obTableSchemaServiceImpl': Unsatisfied dependency expressed through field 'sqlStatContextService': Error creating bean with name 'sqlStatContextServiceImpl': Invocation of init method failed
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlStatContextServiceImpl': Invocation of init method failed
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.sqlStatProperties': Invocation of init method failed
Caused by: java.util.IllegalFormatConversionException: d != java.time.Duration
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'obTableSchemaServiceImpl': Unsatisfied dependency expressed through field 'sqlStatContextService': Error creating bean with name 'sqlStatContextServiceImpl': Invocation of init method failed
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlStatContextServiceImpl': Invocation of init method failed
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.sqlStatProperties': Invocation of init method failed
Caused by: java.util.IllegalFormatConversionException: d != java.time.Duration

ocp-server.log (102.3 KB)

昨天OCP平台做过的操作

ocp metadb主机的配置低,磁盘空间不足

  • 修改过监控数据保留时间

    如下ocp系统参数

    ocp.perf.sql.sql-hist-level2-granularity
    10m
    ocp.perf.sql.sql-hist-level2-query-interval
    48h
    ocp.perf.sql.sql-hist-level2-retention
    15d
    
  • ocp_meta租户的file本地备份文件手动清理过

    清理过backup_set_1_full和backup_set_2_full,历史的全量备份集

ll /data/ocp_metabak/myocp_meta/1753959742/tenant_incarnation_1/1002/data/

drwx------ 6 admin admin 218 Nov 24 15:36 backup_set_3_full
drwx------ 2 admin admin 198 Nov 25 04:59 backup_sets
drwx------ 2 admin admin  53 Nov 21 18:49 check_file
-rw------- 1 admin admin 192 Nov 21 18:49 format.obbak

@OB论坛助手

@论坛小助手

根据您提供的信息,OCP 4.4.0 启动失败的原因可能与 SQL 统计上下文 (sqlStatContextServiceImpl) 的初始化失败有关。具体错误日志显示了 java.util.IllegalFormatConversionException: d != java.time.Duration 的异常,这通常是因为配置文件中的某个时间相关的配置项格式不正确或不兼容。

解决步骤:

  1. 检查配置文件:请检查 OCP 的配置文件(如 ocp.yaml)中与 SQL 统计相关的配置项,确保这些配置项的格式正确。特别是以下配置项:

    • ocp.perf.sql.sql-hist-level2-granularity
    • ocp.perf.sql.sql-hist-level2-query-interval
    • ocp.perf.sql.sql-hist-level2-retention
      确保这些配置项的值格式正确,例如 10m 表示 10 分钟,48h 表示 48 小时,15d 表示 15 天。
  2. 清理旧备份文件:您提到手动清理了 ocp_meta 租户的备份文件,建议重新生成全量备份集,确保备份文件的完整性和一致性。

  3. 日志分析:查看 ocp-server.log 中更详细的日志信息,尤其是 Caused by: java.util.IllegalFormatConversionException: d != java.time.Duration 之前的日志,可能会提供更多线索。

  4. 重启 OCP:在确认配置文件无误后,尝试重启 OCP 服务,观察是否能正常启动。

  5. 联系技术支持:如果以上步骤仍然无法解决问题,建议联系 OceanBase 的技术支持团队,提供详细的日志和配置文件,以便他们进行进一步的诊断和帮助。

具体信息可参考以下文档:

  1. 遇到问题如何向技术支持同学提问
  2. 通过 OCP 部署 OceanBase 集群

记得之前另外的老OCP由于挂载的共享存储盘权限问题历史备份集访问不了,也不影响ocp-server的重启,这次ocp-server报错日志也没报出是备份集问题引起的启动失败

@论坛小助手 ocp-server安装目录没有ocp.yaml配置文件
tree /data/admin/ocp
ocp-server安装目录层级文件.txt (46.1 KB)

连接metadb查询下这个sql
select key, value, description from config_properties where key like “%query-interval%”;

select 'key', value, description from config_properties where `key` like "%query-interval%";
+------+-------+----------------------------------------------------------------------+
| key  | value | description                                                          |
+------+-------+----------------------------------------------------------------------+
| key  | NULL  | 第0级Plan性能数据的最大查询时间区间                                  |
| key  | NULL  | 第0级SQL性能数据的最大查询时间区间                                   |
| key  | NULL  | 第1级SQL性能数据的最大查询时间区间                                   |
| key  | 10h   | 第2级SQL性能数据的建议的最大查询时间区间                             |
| key  | NULL  | SQL 请求分析,第0级SQL性能数据的最大查询时间区间                     |
| key  | NULL  | SQL 请求分析,第1级SQL性能数据的最大查询时间区间                     |
+------+-------+----------------------------------------------------------------------+

第2级SQL性能数据的建议的最大查询时间区间这个参数是不是也改了,0,1,2三级SQL采集的周期要依次递增才行

把昨天ocp上修改的velue都改回nulll,ocp就启动成功了,感谢支持

select id,`key`,value, default_value, description from config_properties where `key` like "%level2%";
+------+---------------------------------------------+-------+---------------+------------------------------------------------------------+
| id   | key                                         | value | default_value | description                                                |
+------+---------------------------------------------+-------+---------------+------------------------------------------------------------+
|  366 | ocp.perf.sql.sql-hist-level2-granularity    | NULL  | 10m           | 第2级SQL性能数据的时间粒度                                 |
|  369 | ocp.perf.sql.sql-hist-level2-query-interval | NULL  | 48h           | 第2级SQL性能数据的建议的最大查询时间区间                   |
|  372 | ocp.perf.sql.sql-hist-level2-retention      | 1d    | 15d           | 第2级SQL性能数据的分区保留时间                             |
+------+---------------------------------------------+-------+---------------+------------------------------------------------------------+


 select id,'key', value, description from config_properties where `key` like "%query-interval%";
+------+------+-------+----------------------------------------------------------------------+
| id   | key  | value | description                                                          |
+------+------+-------+----------------------------------------------------------------------+
|  374 | key  | NULL  | 第0级Plan性能数据的最大查询时间区间                                  |
|  367 | key  | NULL  | 第0级SQL性能数据的最大查询时间区间                                   |
|  368 | key  | NULL  | 第1级SQL性能数据的最大查询时间区间                                   |
|  369 | key  | 10h   | 第2级SQL性能数据的建议的最大查询时间区间                             |
|  403 | key  | NULL  | SQL 请求分析,第0级SQL性能数据的最大查询时间区间                     |
|  404 | key  | NULL  | SQL 请求分析,第1级SQL性能数据的最大查询时间区间                     |
+------+------+-------+----------------------------------------------------------------------+