操作系统的版本
windows 21H1
docker镜像
oceanbase/obce-ce
部署过程
- 查找oceanbase相关的镜像
PS C:\Users\admin> docker search oceanbase NAME DESCRIPTION STARS OFFICIAL AUTOMATED oceanbase/oceanbase-xe OceanBase Database 2.2 Express Edition 3 oceanbase/obce-mini obce-mini is a mini standalone test image fo… 2 obpilot/oceanbase-ce 3 steps to run an OceanBase-CE docker in you… 2 zibuyu886/oceanbase-ce-cluster OceanBase ce cluster 1 oceanbase/oceanbase-ce OceanBase is open source now. This is the do… 1 huweijie/oceanbase-ce-deploy 0 oceanbase/centos7 0 superbigfu/oceanbase 0 hongweiqin/anolisos-oceanbase A tentative deploy of oceanbase. 0 stutiredboy/centos_ob Build environment for OceanBase 3.1 CE. Crea… 0
复制
- pull,需要下载一会儿
PS C:\Users\admin> docker pull obpilot/oceanbase-ce Using default tag: latest latest: Pulling from obpilot/oceanbase-ce 7a0437f04f83: Pull complete 615dc48ac9f1: Pull complete b10c1cdae3af: Pull complete 4f4fb700ef54: Pull complete c0f6c94a6a6a: Pull complete 792630f35e24: Pull complete Digest: sha256:7ac28415cf27ba19cb47acb67a55ebf9848ad73a63d80b7e2e85d653233dbaeb Status: Downloaded newer image for obpilot/oceanbase-ce:latest docker.io/obpilot/oceanbase-ce:latest PS C:\Users\admin> docker images REPOSITORY TAG IMAGE ID CREATED SIZE obpilot/oceanbase-ce latest 943379e0b05b 2 weeks ago 2.25GB oceanbase/obce-mini latest 1a5ca6d233a7 4 months ago 690MB
复制
- 启动容器
- -m 10G:内存 10G
PS C:\Users\admin> docker run -itd -m 10G --name oceanbase-ce obpilot/oceanbase-ce b2c3dcda5062ac3730c237730a4b552e9440504b82c7cdd93bafbf490f4b9618 PS C:\Users\admin> docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b2c3dcda5062 obpilot/oceanbase-ce "/bin/bash" 34 seconds ago Up 32 seconds 2881/tcp, 2883/tcp oceanbase-ce
复制
- 进入容器
PS C:\Users\admin> docker exec -it oceanbase-ce bash [admin@b2c3dcda5062 ~]$ pwd /home/admin [admin@b2c3dcda5062 ~]$ ls bmsql.sql obproxy oceanbase-ce readme.md
复制
- 查看并启动集群
[admin@b2c3dcda5062 ~]$ obd cluster list +------------------------------------------------------------+ | Cluster List | +--------+---------------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +--------+---------------------------------+-----------------+ | obdemo | /home/admin/.obd/cluster/obdemo | deployed | +--------+---------------------------------+-----------------+ [admin@b2c3dcda5062 ~]$ obd cluster start obdemo Get local repositories and plugins ok Open ssh connection ok Cluster param config check ok Check before start observer ok [WARN] (127.0.0.1) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536) Check before start obproxy ok Start observer ok observer program health check ok Connect to observer ok Initialize cluster Cluster bootstrap ok Wait for observer init ok +---------------------------------------------+ | observer | +-----------+---------+------+-------+--------+ | ip | version | port | zone | status | +-----------+---------+------+-------+--------+ | 127.0.0.1 | 3.1.1 | 2881 | zone1 | active | +-----------+---------+------+-------+--------+ Start obproxy ok obproxy program health check ok Connect to obproxy ok Initialize cluster +---------------------------------------------+ | obproxy | +-----------+------+-----------------+--------+ | ip | port | prometheus_port | status | +-----------+------+-----------------+--------+ | 127.0.0.1 | 2883 | 2884 | active | +-----------+------+-----------------+--------+ obdemo running [admin@b2c3dcda5062 ~]$
复制
- 通过obproxy连接数据库
- 用户名 root
- 实例名 sys
- 集群名 obce-single
- 端口号 2883
[admin@b2c3dcda5062 ~]$ obclient -h 127.1 -uroot@sys#obce-single -P2883 -prootPW D123 -c -A oceanbase Welcome to the OceanBase. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.6.25 OceanBase 3.1.1 (r4-8c615943cbd25a6f7b8bdfd8677a13a21709a05e) (Built Oct 21 2021 10:52:05) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [oceanbase]> \q Bye [admin@b2c3dcda5062 ~]$
复制
- 直连observer
- 端口号 2881
- 不写集群名
[admin@b2c3dcda5062 ~]$ obclient -h 127.1 -uroot@sys -P2881 -prootPWD123 -c -A oceanbase Welcome to the OceanBase. Commands end with ; or \g. Your MySQL connection id is 3221487712 Server version: 5.7.25 OceanBase 3.1.1 (r4-8c615943cbd25a6f7b8bdfd8677a13a21709a05e) (Built Oct 21 2021 10:52:05) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [oceanbase]> \q Bye
复制
学习资源
欢迎各位同学一起来交流学习心得!
最后修改时间:2021-12-24 13:51:00
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
您好,您的文章已入选合格奖,10墨值奖励已经到账请查收!
❤️我们还会实时派发您的流量收益。
3年前

评论
相关阅读
2025年4月中国数据库流行度排行榜:OB高分复登顶,崖山稳驭撼十强
墨天轮编辑部
653次阅读
2025-04-09 15:33:27
2025年3月国产数据库大事记
墨天轮编辑部
561次阅读
2025-04-03 15:21:16
OceanBase赋能百丽核心系统上线,护航双11流量洪峰
OceanBase数据库
215次阅读
2025-03-20 20:34:04
OceanBase 单机版发布,针对中小规模业务场景
通讯员
196次阅读
2025-03-28 12:01:19
从理论到实践:深入探索 OceanBase 原生分布式架构
shunwahⓂ️
175次阅读
2025-03-13 16:06:34
OceanBase CEO杨冰:2025年分布式数据库将迎来本地部署和国产升级的全面爆发
通讯员
165次阅读
2025-04-03 09:35:26
OceanBase亮相「党政信息化产品技术选型供需对接会」,助力党政关键业务系统升级
OceanBase
156次阅读
2025-03-27 09:55:58
TP与AP共生之道:OceanBase 4.3.5 HTAP混合负载实战
shunwahⓂ️
124次阅读
2025-03-27 15:04:42
OceanBase首届合作伙伴峰会:携手伙伴共赢云和AI时代
OceanBase数据库
110次阅读
2025-03-26 15:29:59
OceanBase单机版上线|构建分布式到单机场景的全栈解决方案
OceanBase数据库
97次阅读
2025-03-30 17:08:58