首批通过分布式安全可靠测评,为关键业务系统打造
如何从日志中查看 OBServer 的启动过程
更新时间:2026-05-06 09:11
本文举例说明几个重要的场景下如何搜索 OBServer 日志里的关键词。
适用版本
OceanBase 数据库 V2.x 和 V3.x 版本。
操作步骤
查看 OBServer 是否启动,启动的开始。
grep "observer is start" observer.log[2023-06-27 09:00:02.995987] INFO [SERVER] main.cpp:538 [68189][0][Y0-0000000000000000-0-0] [lt=5] observer is start(observer_version="OceanBase 3.2.4.3") sunxiaojie@GuNian obs_reboot % grep "observer is start" observer.log -A 3 [2023-06-27 09:00:02.995987] INFO [SERVER] main.cpp:538 [68189][0][Y0-0000000000000000-0-0] [lt=5] observer is start(observer_version="OceanBase 3.2.4.3") [2023-06-27 09:00:02.996034] INFO [SHARE] ob_config_manager.cpp:123 [68189][0][Y0-0000000000000000-0-0] [lt=8] Using config file(path="etc/observer.config.bin")异步更新分区副本元数据 waiting。
grep "async update pg partition meta table" observer.log[2023-06-27 09:00:18.395526] INFO [SERVER] ob_service.cpp:1035 [68583][Y0-0000000000000000-0-0] [T] async update pg partition meta table success(pg_partition_keys=[{tid:1100611139404081, partition_id:0, part_cnt:0}]) [2023-06-27 09:00:18.850167] INFO [SERVER] ob_service.cpp:1035 [68588][Y0-0000000000000000-0-0] [T] async update pg partition meta table success(pg_partition_keys=[{tid:1099511627927, partition_id:12, part_cnt:0}])查看所有副本报告是否提交。
grep "submit all replicas report" observer.log.20220510222850查看 OBServer 是否初始化成功。
grep "ob server instance init succeed" observer.log[2023-06-27 09:00:07.767261] INFO [SERVER] ob_server.cpp:379 [68189][0][Y0-0000000000000000-0-0] [lt=4] [dc=0] ob server instance init succeed sunxiaojie@GuNian obs_reboot % grep "ob server instance init succeed" observer.log -A 5 [2023-06-27 09:00:07.767261] INFO [SERVER] ob_server.cpp:379 [68189][0][Y0-0000000000000000-0-0] [lt=4] [dc=0] ob server instance init succeed [2023-06-27 09:00:07.767520] INFO ob_page_manager.cpp:57 [69722][0][Y0-0000000000000000-0-0] [lt=0] [dc=0] register pm finish(ret=0, &pm=0x7f77b1452fc0, pm.get_tid()=69722, tenant_id=500) [2023-06-27 09:00:07.767625] INFO [LIB] ob_tsi_factory.h:395 [69722][0][Y0-0000000000000000-0-0] [lt=100] [dc=0] new instance succ [N9oceanbase3lib13MemoryContextE] 0x7f7ac7fc8d60 size=24, tsi=0x7f7b0e255b00查看 OBServer 是否在 replay clog,连接时提示 Server is initializing 时,可以从下面几个关键字排查。
grep "scan process bar" observer.log* -A 2[2023-06-27 09:00:15.247937] INFO [CLOG] ob_log_scan_runnable.cpp:718 [68740][0][Y0-0000000000000000-0-0] [lt=9] [dc=0] scan process bar(curr_file_id=5, start_file_id=4, last_file_id=8, total_file_cnt=5, processed_file_cnt=2, rest_file_cnt=3, estimated_rest_time(second)=0)- 从
start_file_id到last_file_id之间的 clog 文件需要回放。 start_file_id是第一个需要回放的 clog 文件 ID。last_file_id是最后一个需要回放的 clog 文件 ID。cur_file_id是当前处理到的 clog 文件 ID。rest_file_cnt为剩余的需要回放的 clog 的个数。estimated_rest_time即为预计完成的时间。
grep "clog is behind, service starting need to wait" observer.log -A 2[2023-06-27 09:00:24.236395] INFO [SERVER] ob_server.cpp:2161 [68189][0][Y0-0000000000000000-0-0] [lt=7] [dc=0] [NOTICE] clog is behind, service starting need to wait !- 从
查看 OBServer 是否提供服务 start_service_time。
grep "server can start service" observer.log -A 2[2023-06-27 09:00:28.246748] INFO [STORAGE.TRANS] ob_weak_read_service.cpp:168 [68189][0][Y0-0000000000000000-0-0] [lt=8] [dc=0] [WRS] [NOTICE] server can start service(can_start_service=true, safe_weak_read_snapshot=1687827628174382, delta=72358, pkey={tid:1099511627971, partition_id:14, part_cnt:0}) [2023-06-27 09:00:28.246766] INFO [SERVER] ob_server.cpp:609 [68189][0][Y0-0000000000000000-0-0] [lt=11] [dc=0] [NOTICE] observer start service(start_service_time=1687827628246760)查看 RS 是否收到副本报告请求。
grep "receive report replica request" observer.log