本文介绍 Bootstrap 后发现有节点未启动时,如何进行问题的排查以及解决问题。
影响版本
OceanBase V2.2.60 (不包含 V2.2.60)之前版本可能出现该问题。
对于后续版本,如果节点状态为 inactive,搜索 observer.log 的 renew_lease 关键字,确认是由于心跳报错导致节点状态为 inactive 的情况,仍可使用本文档中指定 rootservice_list 的方式解决问题。
[admin@hostname ~]$ cd /home/admin/oceanbase/log
[admin@hostname log]$ cat observer.log | grep renew_lease
问题现象
Bootstrap 后,查询 __all_server 表,发现有 server 为 Inactive 状态。查询结果如下所示。
obclient> SELECT * FROM __all_server;
+---------------+----------+----+-----------------+------------+-----------------+----------+-----------+--------------------+--------------+----------------+-------------------+
| svr_ip | svr_port | id | zone | inner_port | with_rootserver | status | stop_time | start_service_time | first_sessid | with_partition | last_offline_time |
+---------------+----------+----+-----------------+------------+-----------------+----------+-----------+--------------------+--------------+----------------+-------------------+
| xxx.xxx.x.xxx | 2882 | 1 | cn-hangzhou-g_2 | 2881 | 0 | inactive | 0 | 0 | 0 | 1 | 1571158353370228 |
| xxx.xxx.x.xxx | 2882 | 2 | cn-hangzhou-h_3 | 2881 | 0 | inactive | 0 | 0 | 0 | 1 | 1571158353370228 |
| xxx.xxx.x.xxx | 2882 | 3 | cn-hangzhou-i_1 | 2881 | 1 | active | 0 | 1571158344152460 | 0 | 1 | 1571158275246159 |
+---------------+----------+----+-----------------+------------+-----------------+----------+-----------+--------------------+--------------+----------------+-------------------+
可能原因
根据查询结果,可能是由于状态为 Inactive 的节点无法找到当前的 RootService。 并且 rootservice_list 中没有当前 active 的节点信息。
注意
对于 1-1-1 集群,如果一台服务器注册失败,会导致 rootservice_list 中只有两台服务器信息。一旦不在 rootservice_list 中的服务器被选举成功作为新的 RootService,则另外两台服务器会无法识别和注册。
解决方式
使用指定 rootservice_list 参数方式启动 observer 进程。
在状态为 Inactive 的 OBServer 服务器上执行以下命令。
[admin@hostname ~]$ cd oceanbase
[admin@hostname oceanbase]$ ./bin/observer -z cn-hangzhou-g_2 -o "rootservice_list=xxx.xxx.x.xxx:2882:2881;xxx.xxx.x.xxx:2882:2881;xxx.xxx.x.xxx:2882:2881,memory_limit_percentage=90"