一、拉取镜像
[root@p1 ~]# docker pull obpilot/oceanbase-ce Using default tag: latest Trying to pull repository docker.io/obpilot/oceanbase-ce ... latest: Pulling from docker.io/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 obpilot/oceanbase-ce:latest
复制
二、运行docker
[root@p1 ~]# docker run -itd -m 10G -p 2881:2881 -p 2883:2883 --name oceanbase-ce obpilot/oceanbase-ce:latest 3b4397a06cec776742ecd222be878782b334381ce97fd21fef7fc15bd0c6250d [root@p1 ~]# [root@p1 ~]# free -m total used free shared buff/cache available Mem: 12014 564 8429 11 3020 11217 Swap: 2047 0 2047 [root@p1 ~]# docker exec -it oceanbase-ce bash [admin@3b4397a06cec ~]$ obd cluster list +------------------------------------------------------------+ | Cluster List | +--------+---------------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +--------+---------------------------------+-----------------+ | obdemo | /home/admin/.obd/cluster/obdemo | deployed | +--------+---------------------------------+-----------------+ [admin@3b4397a06cec ~]$ [admin@3b4397a06cec ~]$ obd cluster start obdemo Get local repositories and plugins ok Open ssh connection ok Cluster param config check ok Check before start observer ok 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@3b4397a06cec ~]$ obclient -h127.1 -uroot@sys#obce-single -P2883 -prootPWD123 -c -A oceanbase Welcome to the OceanBase. Commands end with ; or \\g. Your MySQL connection id is 3 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]> alter resource unit sys_unit_config min_cpu=5; Query OK, 0 rows affected (0.007 sec) MySQL [oceanbase]> CREATE resource unit S4C1G max_cpu=4, min_cpu=4, max_memory='1G', min_memory='1G', max_iops=10000, min_iops=1000, max_session_num=1000000, max_disk_size='1024G'; Query OK, 0 rows affected (0.007 sec) MySQL [oceanbase]> CREATE resource pool my_pool unit = 'S4C1G', unit_num = 1; Query OK, 0 rows affected (0.012 sec) MySQL [oceanbase]> create tenant obmysql resource_pool_list=('my_pool'), primary_zone='RANDOM',comment 'mysql tenant/instance', charset='utf8' set ob_tcp_invited_nodes='%', ob_compatibility_mode='mysql'; Query OK, 0 rows affected (1.514 sec) MySQL [oceanbase]> quit Bye [admin@3b4397a06cec ~]$ obclient -h 127.1 -uroot@obmysql#obce-single -P2883 -p -c -A test Enter password: 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 [test]> show databases; +--------------------+ | Database | +--------------------+ | oceanbase | | information_schema | | mysql | | test | +--------------------+ 4 rows in set (0.002 sec) MySQL [test]> create database tpch; Query OK, 1 row affected (0.020 sec) MySQL [test]> CREATE TABLE Persons ( -> Personid int NOT NULL AUTO_INCREMENT, -> LastName varchar(255) NOT NULL, -> FirstName varchar(255), -> Age int, -> PRIMARY KEY (Personid) -> ); Query OK, 0 rows affected (0.045 sec)
复制
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
2025年4月中国数据库流行度排行榜:OB高分复登顶,崖山稳驭撼十强
墨天轮编辑部
1887次阅读
2025-04-09 15:33:27
2025年3月国产数据库大事记
墨天轮编辑部
872次阅读
2025-04-03 15:21:16
OceanBase 接入 MCP 架构:贯通数据孤岛,释放 AI 创新潜能
OceanBase数据库
398次阅读
2025-03-28 15:32:52
OceanBase 单机版发布,针对中小规模业务场景
通讯员
259次阅读
2025-03-28 12:01:19
AI关键场景得到全面支持!OceanBase入选Forrester报告三大领域代表厂商
OceanBase数据库
230次阅读
2025-04-19 22:27:54
数据库管理-第313期 分布式挑战单机,OceanBase单机版试玩(20250411)
胖头鱼的鱼缸
210次阅读
2025-04-10 22:41:56
OceanBase CEO杨冰:2025年分布式数据库将迎来本地部署和国产升级的全面爆发
通讯员
201次阅读
2025-04-03 09:35:26
OceanBase亮相「党政信息化产品技术选型供需对接会」,助力党政关键业务系统升级
OceanBase
190次阅读
2025-03-27 09:55:58
OceanBase单机版产品解读
多明戈教你玩狼人杀
180次阅读
2025-04-11 15:28:33
2024年中国联通软研院OceanBase扩容单一来源采购公示
通讯员
157次阅读
2025-04-21 15:55:59