OceanBase 4.5.0.0 单机集群 IP 变更后 obshell 反复读取旧 IP,报 Agent.IP.InconsistentWithOBServer,OBD 托管失效

1. 环境信息

  • OceanBase 版本:4.5.0.0(社区版/企业版?)
  • 部署方式:OBD 部署,单机单副本
  • 集群名:myoceanbase
  • OBD 版本:obd --version 输出
  • obshell 版本:4.3.2.1-12025101110
  • 操作系统:openEuler 24.03 SP1
  • 部署目录:/root/myoceanbase/oceanbase_name
  • 数据目录:/data/1/myoceanbase ,日志目录:/data/log1/myoceanbase

2. 问题背景

服务器 IP 从 10.10.4.252 变更为 50.0.1.20 ,旧 IP 已废弃。数据必须保留,严禁重建集群。

3. 当前状态

  • observer 进程正常运行,2881 端口监听正常
  • sys 租户、业务租户 hlzj 均可连接,业务数据完整
  • __all_server 、__all_unit 、observer.config.bin 均已更新为 50.0.1.20
  • observer.config.bin.history 和 .bak 已删除
  • __all_server_event_history 、__all_rootservice_event_history 中旧 IP 记录已清理
  • .meta 中 all_agent 表已多次删除 10.10.4.252 记录

但 obshell 启动后,.meta 的 all_agent 表中又会出现 10.10.4.252:2886 ,并持续报错:
notice agent 10.10.4.252:2886 to synchronize all_agents
notice agent 10.10.4.252:2886 failed: dial tcp 10.10.4.252:2886: i/o timeout

4. 已尝试的排查

  1. 以 -o 参数覆盖启动 observer,持久化 local_ip 、all_server_list 、rootservice_list 为新 IP
  2. ALTER SYSTEM SET all_server_list = '50.0.1.20:2882'
  3. DELETE FROM oceanbase.__all_server WHERE svr_ip='10.10.4.252' ,并手动 INSERT 新 IP 记录
  4. UPDATE oceanbase.__all_unit SET svr_ip='50.0.1.20' WHERE svr_ip='10.10.4.252'
  5. 用 ob_admin force_set_ls_as_single_replica 恢复各租户 LS 选举
  6. 删除 .meta 后以 --ip 50.0.1.20 重启 obshell
  7. 清理 __all_server_event_history 和 __all_rootservice_event_history 中旧 IP 记录
  8. 删除 observer.config.bin.history 和 .bak

每次清理后,obshell 启动时仍会从某个未定位的数据源读到 10.10.4.252:2886 ,重新写入 .meta 。

5. 已确认无旧 IP 的位置

  • observer.config.bin (当前配置)
  • __all_server
  • __all_unit
  • __all_ls_meta_table
  • __all_ls_status
  • __all_server_event_history
  • __all_rootservice_event_history
  • DBA_OB_SERVERS 、DBA_OB_UNITS
  • ~/.obd/cluster/myoceanbase/config.yaml
  • ~/.obd/cluster/myoceanbase/.data
  • observer.config.bin.history 和 .bak (已删除)
  • etc2/ 、etc3/ 下的配置
2 个赞

ob其实不支持改ip地址 你把日志发一下 obshell日志 observer.log都发一下