资讯专栏INFORMATION COLUMN

Docker安装部署分布式数据库 OceanBase的详细过程

3119555200 / 814人阅读

docker部署OceanBase


第一步  ob docker镜像下载


下载镜像


docker pull obpilot/oceanbase-ce:latest


1.png


第二步  容器创建


新容器创建


docker run -itd -m 10G -p 2881:2881 -p 2883:2883
–name oceanbase-ce obpilot/oceanbase-ce:latest

进入容器


[root@jeames ~]# docker exec -it oceanbase-ce bash


进入容器后,可以看看 readme.md 文档


2.png


第三步  查看集群及启动


启动集群


[admin@3ef732cfb95a ~]$ obd cluster list
配置文件:/home/admin/.obd/cluster/obdemo/config.yaml


3.png


启动集群


[admin@3ef732cfb95a ~]$ obd cluster start obdemo


4.png


第四步  ob数据库登录,租户创建


admin 用户的密码是 : adminPWD123
[admin@3ef732cfb95a ~]$ 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]> show databases;
+--------------------+
| Database |
+--------------------+
| oceanbase |
| information_schema |
| mysql |
| SYS |
| LBACSYS |
| ORAAUDITOR |
| test |
+--------------------+
7 rows in set (0.014 sec)


5.png


创建资源单元、资源池、租户


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';
MySQL [oceanbase]> CREATE resource pool my_pool unit = 'S4C1G', unit_num = 1;
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';


第五步  obmysql tenant登录,数据库及表的创建


[admin@3ef732cfb95a ~]$ 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 7
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.005 sec)
MySQL [test]> create database mesdb charset utf8mb4;
Query OK, 1 row affected (0.118 sec)
MySQL [test]> use mesdb
Database changed
MySQL [mesdb]>
MySQL [mesdb]>
MySQL [mesdb]>
MySQL [mesdb]> source /tmp/mysql_employees.sql


6.png



文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/127848.html

相关文章

  • 后端好书阅读与推荐(续四)

    摘要:后端好书阅读与推荐系列文章后端好书阅读与推荐后端好书阅读与推荐续后端好书阅读与推荐续二后端好书阅读与推荐续三后端好书阅读与推荐续四这里依然记录一下每本书的亮点与自己读书心得和体会,分享并求拍砖。 后端好书阅读与推荐系列文章:后端好书阅读与推荐后端好书阅读与推荐(续)后端好书阅读与推荐(续二)后端好书阅读与推荐(续三)后端好书阅读与推荐(续四) 这里依然记录一下每本书的亮点与自己读书心得...

    phodal 评论0 收藏0
  • 厉害了,蚂蚁金服!创造了中国自己据库OceanBase(下)

    摘要:技术成就划时代的分布式数据库通过核心业务的不断上线,蚂蚁金服帮助渡过了自研基础软件产品最艰难的应用关。年天猫双十一,支付宝创造了万笔每秒支付峰值的业界新纪录,这对于数据库来说,意味着每秒需要同时运行万条。 技术成就:划时代的分布式数据库 通过核心业务的不断上线,蚂蚁金服帮助OceanBase渡过了自研基础软件产品最艰难的应用关。OceanBase不只是被研发出来的,更是被用出来的,是在...

    shiina 评论0 收藏0

发表评论

1条评论

1051476572

评论于2022-09-28 12:55

回复0 赞同1 删除
最新活动
阅读需要支付1元查看
<