25.docker-Oceanbase
目录
oceabase
官网
docker pull oceanbase/oceanbase-ce:latest
配置文件
https://github.com/oceanbase/docker-images/blob/main/oceanbase-ce/README_CN.md
version: "3.9"
services:
postgres:
image: oceanbase/oceanbase-ce:latest
container_name: oceanbase
restart: always
environment:
MODE: mini
OB_SYS_PASSWORD: 123456
OB_TENANT_PASSWORD: 123456
OB_MEMORY_LIMIT: 2G
ports:
- 2881:2881
volumes:
- ./data/obd/cluster:/root/.obd/cluster
- ./data/init/:/root/boot/init.d
启动日志:
(base) ➜ oceabase docker logs -f oceanbase
do normal boot
oceanbase-ce-4.3.5.2 already installed.
+--------------------------------------------------------------------------------------------+
| Packages |
+--------------+---------+------------------------+------------------------------------------+
| Repository | Version | Release | Md5 |
+--------------+---------+------------------------+------------------------------------------+
| oceanbase-ce | 4.3.5.2 | 102010012025052715.el8 | 791753420363b1a71ccba150abd74ebbd3c86fd8 |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Load param plugin ok
Open ssh connection ok
Initializes observer work home ok
Parameter check ok
Remote oceanbase-ce-4.3.5.2-102010012025052715.el8-791753420363b1a71ccba150abd74ebbd3c86fd8 repository install ok
Remote oceanbase-ce-4.3.5.2-102010012025052715.el8-791753420363b1a71ccba150abd74ebbd3c86fd8 repository lib check !!
Try to get lib-repository
oceanbase-ce-libs-4.3.5.2 already installed.
Remote oceanbase-ce-libs-4.3.5.2-102010012025052715.el8-43f45e3c89e095dd6871cd5cdb40ce36520be193 repository install ok
Remote oceanbase-ce-4.3.5.2-102010012025052715.el8-791753420363b1a71ccba150abd74ebbd3c86fd8 repository lib check ok
obcluster deployed
Please execute ` obd cluster start obcluster ` to start
Trace ID: 67c9ecc8-66f2-11f0-8454-0242ac150002
If you want to view detailed obd logs, please run: obd display-trace 67c9ecc8-66f2-11f0-8454-0242ac150002
Get local repositories ok
Load cluster param plugin ok
Open ssh connection ok
[WARN] OBD-1011: (172.21.0.2) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
[WARN] OBD-1007: (172.21.0.2) The recommended number of core file size is unlimited (Current value: 0)
[WARN] OBD-1007: (172.21.0.2) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (172.21.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.21.0.2) The value of the "vm.overcommit_memory" must be 0 (Current value: 1, Recommended value: 0)
[WARN] OBD-1017: (172.21.0.2) The value of the "fs.file-max" must be greater than 6573688 (Current value: 801613, Recommended value: 6573688)
[ERROR] OBD-2000: (172.21.0.2) not enough memory. (Free: 4G, Buff/Cache: 2G, Need: 6G), Please reduce the `memory_limit` or `memory_limit_percentage`
[WARN] OBD-1012: (172.21.0.2) clog and data use the same disk (/)
You can use the `obd cluster init4env obcluster` command to automatically configure system parameters
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 6a865960-66f2-11f0-bc63-0242ac150002
If you want to view detailed obd logs, please run: obd display-trace 6a865960-66f2-11f0-bc63-0242ac150002
boot failed!
find obd deploy information, skip configuring...
start ob cluster ...
Get local repositories ok
Load cluster param plugin ok
Open ssh connection ok
[WARN] OBD-1011: (172.21.0.2) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
[WARN] OBD-1007: (172.21.0.2) The recommended number of core file size is unlimited (Current value: 0)
[WARN] OBD-1007: (172.21.0.2) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (172.21.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.21.0.2) The value of the "vm.overcommit_memory" must be 0 (Current value: 1, Recommended value: 0)
[WARN] OBD-1017: (172.21.0.2) The value of the "fs.file-max" must be greater than 6573688 (Current value: 801613, Recommended value: 6573688)
[ERROR] OBD-2000: (172.21.0.2) not enough memory. (Free: 4G, Buff/Cache: 2G, Need: 6G), Please reduce the `memory_limit` or `memory_limit_percentage`
[WARN] OBD-1012: (172.21.0.2) clog and data use the same disk (/)
You can use the `obd cluster init4env obcluster` command to automatically configure system parameters
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 6c822f6e-66f2-11f0-97f6-0242ac150002
If you want to view detailed obd logs, please run: obd display-trace 6c822f6e-66f2-11f0-97f6-0242ac150002
Tue Jul 22 11:53:05 UTC 2025
boot success!
上面的日志结果并没有真正的启动 server 需要进入容器内执行:obd cluster start obcluster
但是依然报错:OBD-2002: Failed to start 172.17.0.2 observer
https://ask.oceanbase.com/t/topic/35611626/12
MAC Intel 无法使用docker部署
docker run -d -p 2881:2881 --name oceanbase oceanbase/oceanbase-ce