问题现象
白屏现象
升级 OCP 到 V4.3.1 版本,OAT 上子任务
update_first_container_and_meta失败。新部署 OCP V4.3.1 版本,OAT 子任务
init_ocp_meta失败。
日志现象
检查 OCP 的 Docker 日志,发现 ocp-server_00 进程频繁异常退出。
例如,以下是 docker logs ocp 命令查看 OCP 容器日志的输出,显示了 ocp-server_00 进程的异常情况。
docker logs ocp 2024-07-30 19:10:44,915 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. 2024-07-30 19:10:44,915 INFO Included extra file "/etc/supervisor/conf.d/ic.conf" during parsing 2024-07-30 19:10:44,915 INFO Included extra file "/etc/supervisor/conf.d/ocp.conf" during parsing 2024-07-30 19:10:44,918 INFO RPC interface 'supervisor' initialized 2024-07-30 19:10:44,918 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2024-07-30 19:10:44,918 INFO supervisord started with pid 1 2024-07-30 19:10:45,921 INFO spawned: 'ocp-server_00' with pid 10 2024-07-30 19:10:45,923 INFO spawned: 'ic-server_00' with pid 11 2024-07-30 19:10:46,065 WARN exited: ocp-server_00 (exit status 1; not expected) 2024-07-30 19:10:47,068 INFO spawned: 'ocp-server_00' with pid 68 2024-07-30 19:10:47,068 INFO success: ic-server_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2024-07-30 19:10:47,200 WARN exited: ocp-server_00 (exit status 1; not expected) 2024-07-30 19:10:49,204 INFO spawned: 'ocp-server_00' with pid 121 2024-07-30 19:10:49,343 WARN exited: ocp-server_00 (exit status 1; not expected) 2024-07-30 19:10:52,349 INFO spawned: 'ocp-server_00' with pid 174 2024-07-30 19:10:52,483 WARN exited: ocp-server_00 (exit status 1; not expected) 2024-07-30 19:10:53,484 INFO gave up: ocp-server_00 entered FATAL state, too many start retries too quickly 2024-07-30 19:11:45,943 INFO exited: ic-server_00 (exit status 0; expected)OCP 的 ocp-server.0.err 日志报错 Cannot allocate memory,例如。
/home/admin/ocp-server/bin/ocp-server: line 13: container_type: command not found OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000fff328000000, 47043313664, 0) failed; error='Cannot allocate memory' (errno=12) /home/admin/ocp-server/bin/ocp-server: line 13: container_type: command not found OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000fff43c000000, 47043313664, 0) failed; error='Cannot allocate memory' (errno=12) /home/admin/ocp-server/bin/ocp-server: line 13: container_type: command not found OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000fff420000000, 47043313664, 0) failed; error='Cannot allocate memory' (errno=12) /home/admin/ocp-server/bin/ocp-server: line 13: container_type: command not found OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000fff274000000, 47043313664, 0) failed; error='Cannot allocate memory' (errno=12)
问题原因
OCP V4.3.1 启动脚本 BUG,OCP 进程没有获取到 OCP 容器的内存,使用服务器内存分配给 JVM,从而导致容器 OOM 去 Kill OCP 进程,造成 ocp-server 进程不断重启。
影响租户
影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。
适用版本
OCP V4.3.1(20240726162809)版本。
OAT V4.x 版本。
解决方法
通过 OAT 升级场景
进入任务失败节点的 OCP 容器。
docker exec -it ocp bash修改 OCP 启动脚本
编辑
/home/admin/ocp-server/bin/ocp-server,找到下面图片红框标注的地方进行修改。
修改为。

如果操作系统使用的是 cgroup v2,还需要修改获取 cgroup mem 大小的逻辑,修改为。

注意
确保正确修改
/home/admin/ocp-server/bin/ocp-server的内容,如果修改错误会造成 OCP 无法启动。如果遇到问题,可以联系 OceanBase 技术支持咨询。重启 OCP 容器。
docker restart ocp等待 OCP 服务恢复正常。
白屏操作。
等待上述修改的 OCP 节点服务恢复,白屏访问第一个 OCP 节点,确定版本号已经更新。
OAT 上白屏跳过
update_first_container_and_meta子任务。(如果专有云场景 不能跳过此任务,需要通过在 OAT 重试失败任务,然后按照步骤 2、3 重新修改操作,等待 OAT 上此任务自动完成)。如果是 OCP 多节点部署模式,OAT 升级任务完成之后,需要把其他节点 OCP 也按照步骤 2 进行修改。
尽快升级 OCP 版本。
不推荐使用OCP V4.3.1版本,建议升级为 OCP V4.3.1 BP1 或更新版本。
通过 OAT 新安装场景
不推荐使用 OCP V4.3.1 版本,在 OAT 放弃安装任务,更换 OCP 版本进行安装。
规避方式
更换 OCP 版本,不推荐使用 OCP V4.3.1(20240726162809)版本。