---
title: OceanBase 数据库 V4.0 版本中有关 bootstrap 问题的排查-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于 OceanBase 数据库 V4.0 版本中有关 bootstrap 问题的排查相关的常见问题和使用技巧，帮助您快速解决 OceanBase 数据库 V4.0 版本中有关 bootstrap 问题的排查的难题。
---
切换语言

- 简体中文
- English

划线反馈

# OceanBase 数据库 V4.0 版本中有关 bootstrap 问题的排查

更新时间：2024-05-07 03:21

适用版本： V4.0.x 内容类型：Troubleshoot  

bootstrap 命令大体分为三个阶段，所有 bootstrap 流程可以通过 `BOOTSTRAP` 关键字日志串起来，在相应的 server 上搜索 `BOOTSTRAP` 关键字即可查看 bootstrap 进度。

- prepare_bootstrap 阶段：在执行 bootstrap 命令的 server 上执行，负责创建系统租户日志流。

  ```shell
  STEP_2.1:check_all_server_bootstrap_mode_match execute success, cost=6255
  STEP_2.2:check_is_all_server_empty execute success, cost=6140
  STEP_2.3:notify_sys_tenant_server_unit_resource execute success, cost=719252
  STEP_2.4:create_log_stream execute success, cost=61202
  STEP_2.5:wait_elect_log_stream execute success, cost=6254
  STEP_2.6:prepare_bootstrap execute success, cost=7

  ```
 - execute_bootstrap阶段：系统租户日志流创建成功后，后续的 bootstrap 流程会在系统租户日志流 Leader 完成，负责创建内部表，初始化 schema 数据，创建系统租户。

  ```shell
  STEP_1.1:execute_bootstrap start to executor
  STEP_1.2:reload_freeze_info execute success
  STEP_3.1:check_is_already_bootstrap execute success,
  STEP_3.2:add_rs_list execute success
  STEP_3.3:prepare_create_partition execute success
  STEP_3.4:create_all_core_table_partition execute success
  STEP_3.5:wait_all_rs_online execute success
  ......
  ......
  STEP_3.3812:execute_bootstrap execute success

  ```
 - 启动服务阶段：启动 RS 服务，初始化系统。

  ```shell
  start to do_restart
  execute_bootstrap finished

  ```

## prepare_bootstrap 阶段

在 observer.log 日志中搜索 `BOOTSTRAP` 关键字，确认 BOOTSTRAP 流程进度和trace id 。

```shell
grep BOOTSTRAP observer.log.20* observer.log

```

如果存在以下日志，说明 `prepare_bootstrap` 流程成功。如果不存在以下日志，则说明某一步失败了，可以根据 trace id 进一步定位失败的地方。

```shell
prepare_bootstrap execute success

```

典型日志如下图所示：

![image0018.png](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/sql/20240328bootstarp00018.png)

## execute_bootstrap 阶段

在 rootservice.log 日志中搜索 `BOOTSTRAP` 关键字，查看进度信息。

```shell
grep BOOTSTRAP rootservice.log

```

查看是否存在以下日志，如果存在则说明 `execute_bootstrap` 已经成功。

```shell
execute_bootstrap execute success

```

下面介绍典型的错误排查方法。

1. 如果最后的错误日志在反复打印以下日志，说明对应的 server 没有汇报自己信息。

   ```shell
   server is not alive(server="100.83.6.47:60000", is_alive=false)

   ```
 2. 在对应 server 的 observer.log 中搜索以下日志，根据 trace id 排查错误原因。

   ```shell
   grep register_self observer.log

   ```

## 启动服务阶段

在 RS 的 rootservice.log 中，搜索 `BOOTSTRAP` 关键字，查看是否存在以下日志，如果存在，说明 bootstrap 成功。

```shell
execute_bootstrap finished

```

如果 `BOOTSTRAP` 关键字最后一条日志卡在 `start to do_restart`，说明其他线程在持有锁执行 `do_restart`。搜索以下关键字，根据 trace id 继续排查错误原因。

```shell
grep START_SERVICE observer.log rootservice.log

```

## 适用版本

OceanBase 数据库 V4.0.x 版本。

Previous

[Bootstrap 失败，错误代码 4015](https://www.oceanbase.com/knowledge-base/oceanbase-database-20000000103)

Next

[Bootstrap 失败，错误代码 4016](https://www.oceanbase.com/knowledge-base/oceanbase-database-20000000100) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
