macos 上docker中运行 ob 4.2 报启动失败

【 使用环境 】 macos docker desktop
【 OB or 其他组件 】
ob 4.2.1
【问题描述】手册建议方法在 docker 上运行:docker run -p 2881:2881 --name obstandalone -e MINI_MODE=1 -d oceanbase/oceanbase-ce,运行的 docker descktop 分配的内存 9.8G,但是运行后试用 docker logs obstandalone|tail -50f 日志如下:[WARN] OBD-1011: (172.17.0.2) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
[WARN] OBD-1007: (172.17.0.2) The recommended number of core file size is unlimited (Current value: 0)
[WARN] OBD-1007: (172.17.0.2) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (172.17.0.2) The value of the “vm.max_map_count” must be within [327600, 1310720] (Current value: 262144, Recommended value: 655360)
[WARN] OBD-1017: (172.17.0.2) The value of the “fs.file-max” must be greater than 6573688 (Current value: 1044336, Recommended value: 6573688)
[WARN] OBD-1012: (172.17.0.2) clog and data use the same disk (/)

Check before start obagent ok
Start observer ok
observer program health check x
[WARN] OBD-2002: Failed to start 172.17.0.2 observer
[ERROR] oceanbase-ce start failed
See OceanBase分布式数据库-海量数据 笔笔算数 .
Trace ID: 8de264b4-9ca3-11ee-86e5-0242ac110002
If you want to view detailed obd logs, please run: obd display-trace 8de264b4-9ca3-11ee-86e5-0242ac110002
/////////////////////// phase end: 30.875 s ///////////////////////
/////////////////////// STEP 5: Ob-deploy Create Tenant ///////////////////////
Deploy “obcluster” is deployed
See OceanBase分布式数据库-海量数据 笔笔算数 .
Trace ID: 9fde39d6-9ca3-11ee-8f2a-0242ac110002
If you want to view detailed obd logs, please run: obd display-trace 9fde39d6-9ca3-11ee-8f2a-0242ac110002
deploy failed!
docker inspect oeanbase/oceanbase-ce 信息如下:
[
{
“Id”: “sha256:fbf1216b8fb4bee1dcc6f8a8d2798020480782cd3e4455c8a78a01520b825201”,
“RepoTags”: [
“oceanbase/oceanbase-ce:latest”
],
“RepoDigests”: [
“oceanbase/oceanbase-ce@sha256:c11bf46192815843b0b2470b5c482f835d686b0fddfbd9a3d237af7a907a43af”
],
“Parent”: “”,
“Comment”: “buildkit.dockerfile.v0”,
“Created”: “2023-12-07T03:50:44.093013592Z”,
“Container”: “”,
“ContainerConfig”: {
“Hostname”: “”,
“Domainname”: “”,
“User”: “”,
“AttachStdin”: false,
“AttachStdout”: false,
“AttachStderr”: false,
“Tty”: false,
“OpenStdin”: false,
“StdinOnce”: false,
“Env”: null,
“Cmd”: null,
“Image”: “”,
“Volumes”: null,
“WorkingDir”: “”,
“Entrypoint”: null,
“OnBuild”: null,
“Labels”: null
},
“DockerVersion”: “”,
“Author”: “”,
“Config”: {
“Hostname”: “”,
“Domainname”: “”,
“User”: “”,
“AttachStdin”: false,
“AttachStdout”: false,
“AttachStderr”: false,
“ExposedPorts”: {
“2881/tcp”: {}
},
“Tty”: false,
“OpenStdin”: false,
“StdinOnce”: false,
“Env”: [
“PATH=/root/boot:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”,
“OBVersion=4.2.1.2-102000042023120514”,
“LD_LIBRARY_PATH=/root/ob/lib:”
],
“Cmd”: [
“/bin/sh”,
“-c”,
“_boot”
],
“ArgsEscaped”: true,
“Image”: “”,
“Volumes”: null,
“WorkingDir”: “/root”,
“Entrypoint”: null,
“OnBuild”: null,
“Labels”: {
“maintainer”: “OpenAnolis Cloud Native SIG”,
“org.opencontainers.image.created”: “2023-03-24 10:49:55+0800”,
“org.opencontainers.image.licenses”: “Mulan PSL v2”,
“org.opencontainers.image.title”: “Anolis OS Base Image”,
“org.opencontainers.image.vendor”: “Anolis OS”
}
},
“Architecture”: “amd64”,
“Os”: “linux”,
“Size”: 622667383,
“VirtualSize”: 622667383,
“GraphDriver”: {
“Data”: {
“LowerDir”: “/var/lib/docker/overlay2/e88f6bf8f375d0f70ba0c7e3d8de2006259c89639ffb8448504920068278356c/diff:/var/lib/docker/overlay2/859c15087d22f8943856cc538b5c752226ebbe1ea65688f437dac2c2e6f3cb05/diff:/var/lib/docker/overlay2/83abdc0d3732360e4fbb414178741e320fe5746d8613550c028fcfb1fdc902cd/diff:/var/lib/docker/overlay2/7203f4f6727348c94aab0bcbd71361d91f7a7bb8698b10b08e97fabc054e79c9/diff”,
“MergedDir”: “/var/lib/docker/overlay2/8c09a7bd3fc36a0910f8a22c4ea3adb072233eb276b82083320daaeb733b8ec7/merged”,
“UpperDir”: “/var/lib/docker/overlay2/8c09a7bd3fc36a0910f8a22c4ea3adb072233eb276b82083320daaeb733b8ec7/diff”,
“WorkDir”: “/var/lib/docker/overlay2/8c09a7bd3fc36a0910f8a22c4ea3adb072233eb276b82083320daaeb733b8ec7/work”
},
“Name”: “overlay2”
},
“RootFS”: {
“Type”: “layers”,
“Layers”: [
“sha256:8dff2b73bdd5672e410af214c174ade52d0b590e6a8662eb71741086c783f6cc”,
“sha256:b5ebcae49b349689d95bbca7de32f3f71dc8244503796b2e85a28de62b5fbf39”,
“sha256:ffe0254e2febf93d1673551071f05035c77d77d71d8e5dd3ed76e9cecec0ac40”,
“sha256:33e2e547d3fd1dbd060e364d94f4132d800eb7184cb8536e773429d7d2b70540”,
“sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef”
]
},
“Metadata”: {
“LastTagTime”: “0001-01-01T00:00:00Z”
}
}
]
【复现路径】在 macOS 上安装 docker desktop 分配内存资源 9.8G ,使用 docker pull oceanbase/oceanbase-ce;docker run -p 2881:2881 --name obstandalone -e MINI_MODE=1 -d oceanbase/oceanbase-ce;docker logs obstandalone|tail -50f
【附件及日志】docker 中 ob 实例无法运行,obdiag 无法运行。推荐使用OceanBase敏捷诊断工具obdiag收集诊断信息,详情参见链接(右键跳转查看):

【SOP系列 22 】——故障诊断第一步(自助诊断和诊断信息收集)

我转给对应同学看看

observer挂掉了,上传一个observer的日志上来看一下

是不是内存资源不够

挂掉了没法看,启动日志已经粘贴在上面了

内存资源不够启动时会报错吧,从日志中没有看到,目前配置是10G,ob最小需要多大

docker run 失败的原因看由于启动ob失败造成的:
2023-12-20 11:25:53 Check before start obagent ok
2023-12-20 11:25:54 Start observer ok
详细信息参考,在docker中如何看到更详细ob server失败的原因?
2023-12-20 11:25:57 observer program health check x
2023-12-20 11:25:57 [WARN] OBD-2002: Failed to start 172.17.0.2 observer
2023-12-20 11:25:57 [ERROR] oceanbase-ce start failed
2023-12-20 11:25:57 See https://www.oceanbase.com/product/ob-deployer/error-codes .
2023-12-20 11:25:57 Trace ID: 6b3318aa-9ee7-11ee-95bb-0242ac110002
2023-12-20 11:25:57 If you want to view detailed obd logs, please run: obd display-trace 6b3318aa-9ee7-11ee-95bb-0242ac110002
/////////////////////// phase end: 31.704 s ///////////////////////
2023-12-20 11:25:57 /////////////////////// STEP 5: Ob-deploy Create Tenant ///////////////////////
2023-12-20 11:25:57 Deploy “obcluster” is deployed
2023-12-20 11:25:57 See https://www.oceanbase.com/product/ob-deployer/error-codes .
2023-12-20 11:25:57 Trace ID: 7dab1bae-9ee7-11ee-8e89-0242ac110002
2023-12-20 11:25:57 If you want to view detailed obd logs, please run: obd display-trace 7dab1bae-9ee7-11ee-8e89-0242ac110002
2023-12-20 11:25:57 deploy failed!
2023-12-20 11:25:53 Check before start obagent ok
2023-12-20 11:25:54 Start observer ok
2023-12-20 11:25:57 observer program health check x
2023-12-20 11:25:57 [WARN] OBD-2002: Failed to start 172.17.0.2 observer
2023-12-20 11:25:57 [ERROR] oceanbase-ce start failed
2023-12-20 11:25:57 See https://www.oceanbase.com/product/ob-deployer/error-codes .
2023-12-20 11:25:57 Trace ID: 6b3318aa-9ee7-11ee-95bb-0242ac110002
2023-12-20 11:25:57 If you want to view detailed obd logs, please run: obd display-trace 6b3318aa-9ee7-11ee-95bb-0242ac110002
/////////////////////// phase end: 31.704 s ///////////////////////
2023-12-20 11:25:57 /////////////////////// STEP 5: Ob-deploy Create Tenant ///////////////////////
2023-12-20 11:25:57 Deploy “obcluster” is deployed
2023-12-20 11:25:57 See https://www.oceanbase.com/product/ob-deployer/error-codes .
2023-12-20 11:25:57 Trace ID: 7dab1bae-9ee7-11ee-8e89-0242ac110002
2023-12-20 11:25:57 If you want to view detailed obd logs, please run: obd display-trace 7dab1bae-9ee7-11ee-8e89-0242ac110002
2023-12-20 11:25:57 deploy failed!

老师好,我碰见了相同的问题,也是mac os上docker部署OB,容器第一次启动正常,如果把容器停止再启动,就无法启动。我通过docker container cp获取了observer日志
observer.log (805.5 KB)

1 个赞