ERROR 4005 : The object is initialized twice

【产品名称】oceanbase 企业版

【产品版本】3.1.2

【问题描述】在进行黑屏初始化的时候出现初始化已完成的报错,需要再次初始化,请问,这个报错后面的原理是什么? 如果只有不断的清除目录来重新做,显得比较笨拙。

[2021-09-08 11:42:57.015678] WARN [BOOTSTRAP] prepare_bootstrap (ob_bootstrap.cpp:378) [96065][1454][YB4264521513-0005CB738E543C9

A] [lt=3] [dc=0] STEP_2.3:prepare_bootstrap execute fail, cost=8

[2021-09-08 11:42:57.015687] ERROR [BOOTSTRAP] bootstrap (ob_service.cpp:2781) [96065][1454][YB4264521513-0005CB738E543C9A] [lt=3]

 [dc=0] failed to prepare boot strap(rs_list=[region:"default_region", zone:"zone1", server:"100.82.21.19:2882", region:"default_r

egion", zone:"zone2", server:"11.164.28.197:2882", region:"default_region", zone:"zone3", server:"100.82.21.7:2882"], ret=-4005) B

ACKTRACE:0x999870a 0x2b47792 0x2b468f8 0x2b464d2 0x4860ee9 0x6c32679 0x6ca477f 0x27e4ab7 0x27e2683 0x27dd695 0x6e1850b 0x3105e50 0

x97d5757 0x97d2bd0 0x97ce09f

[2021-09-08 11:42:57.015760] WARN [BOOTSTRAP] execute (ob_alter_system_executor.cpp:1230) [96064][1452][YB4264521513-0005CB738E54

3C9A] [lt=3] [dc=0] STEP_0.1:alter_system execute fail

[2021-09-08 11:42:57.965739] INFO [BOOTSTRAP] ob_bootstrap.cpp:499 [96065][1454][YB4264521513-0005CB738E543C9B] [lt=8] [dc=0] suc

ceed to pick sys tenant primary zone(ret=0, primary_zone=zone1)

[2021-09-08 11:42:57.966174] INFO [BOOTSTRAP] ob_bootstrap.cpp:767 [96065][1454][YB4264521513-0005CB738E543C9B] [lt=6] [dc=0] STE

P_2.1:check_all_server_bootstrap_mode_match execute success, cost=445

[2021-09-08 11:42:57.966478] WARN [BOOTSTRAP] check_is_all_server_empty (ob_bootstrap.cpp:795) [96065][1454][YB4264521513-0005CB7

38E543C9B] [lt=6] [dc=0] server is not empty(server="11.164.28.197:2882")

[2021-09-08 11:42:57.966485] INFO [BOOTSTRAP] ob_bootstrap.cpp:800 [96065][1454][YB4264521513-0005CB738E543C9B] [lt=6] [dc=0] STE

P_2.2:check_is_all_server_empty execute success, cost=310

[2021-09-08 11:42:57.966488] WARN [BOOTSTRAP] prepare_bootstrap (ob_bootstrap.cpp:364) [96065][1454][YB4264521513-0005CB738E543C9

B] [lt=2] [dc=0] cannot do bootstrap on not empty server(ret=-4005)

[2021-09-08 11:42:57.966492] WARN [BOOTSTRAP] prepare_bootstrap (ob_bootstrap.cpp:378) [96065][1454][YB4264521513-0005CB738E543C9

B] [lt=3] [dc=0] STEP_2.3:prepare_bootstrap execute fail, cost=7

[2021-09-08 11:42:57.966500] ERROR [BOOTSTRAP] bootstrap (ob_service.cpp:2781) [96065][1454][YB4264521513-0005CB738E543C9B] [lt=2]

 [dc=0] failed to prepare boot strap(rs_list=[region:"default_region", zone:"zone1", server:"100.82.21.19:2882", region:"default_r

egion", zone:"zone2", server:"11.164.28.197:2882", region:"default_region", zone:"zone3", server:"100.82.21.7:2882"], ret=-4005) B

ACKTRACE:0x999870a 0x2b47792 0x2b468f8 0x2b464d2 0x4860ee9 0x6c32679 0x6ca477f 0x27e4ab7 0x27e2683 0x27dd695 0x6e1850b 0x3105e50 0

x97d5757 0x97d2bd0 0x97ce09f

[2021-09-08 11:42:57.966557] WARN [BOOTSTRAP] execute (ob_alter_system_executor.cpp:1230) [96064][1452][YB4264521513-0005CB738E54

3C9B] [lt=3] [dc=0] STEP_0.1:alter_system execute fail


这个报错是 bootstrap 前面失败过一次,后面再次重试的时候会提示已经初始化过一次(哪怕是初始化失败)。

bootstrap 主要是集群各个节点互相投票选举出主副本并初始化集群元数据表。根据这个原理很难去排查失败原因。通常的经验是检查下面几个方面:

  • 集群各个节点的observer 进程都正常启动,监听端口正常,彼此通信正常。
  • 集群各个节点之间的网络延时很小,在50ms以内.
  • 集群各个节点的之间的时间同步延时很小,在10ms以内。
  • 集群各个节点的本地目录权限和空间大小都正常。空间是个很难理解和处理的地方。如果 数据和日志目录分开多个盘,最好。日志目录剩余空间目录不低于 95% 。如果数据和日志共盘,那要显式的约束 datafile_size 大小,以为 日志目录留给必要的剩余空间(不低于内存的2倍)。

具体请参考个人官方号总结:OceanBase 2.2 安装部署问题解答 (qq.com)



  • 集群各个节点资源(尤其是内存资源够用),memory_limit 扣除 system_memory后还要有6G 内存够创建默认租户资源。
  • 集群各个节点的启动参数里 zone 、ip  信息跟 bootstrap 语句中的 zone和ip能对应上。

[2021-09-08 11:42:57.966488] WARN [BOOTSTRAP] prepare_bootstrap (ob_bootstrap.cpp:364) [96065][1454][YB4264521513-0005CB738E543C9

B] [lt=2] [dc=0] cannot do bootstrap on not empty server(ret=-4005)

报错的原因是 集群不是一个空集群,已经做过初始化;

请问第一次bootstrape具体报的什么错?目前看起来应该是做成功的;bootstrape是不能重试的,只能做一次;