暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

实验一docker下安装oceanbase

原创 qtiger 2022-06-25
1613

docker下体验OceanBase

操作系统

cat /etc/redhat-release

内存

df –h

cpu

cat /proc/cpuinfo |grep grep processor

安装docker

查找oceanbase镜像

docker search oceanbase

拉取OceanBase ce容器

docker pull obpilot/oceanbase-ce:latest

运行OceanBase ce容器

docker run –itd –m 10g –name oceanbase-ce obpilot/oceanbase-ce:latest

启动oceanbase-ce

docker exec –it oceanbase-ce bash

obd cluster restart obdemo

获取集群详细信息

odb cluster display obdemo

创建mysql租户

obclient -h127.1 -uroot@sys -P2881 -prootPWD123 -c -A oceanbase

obclient -h127.1 -uroot@sys#obce-single -P2883 -prootPWD123 -c -A oceanbase

create resource unit S1C1G max_cpu=1,max_memory='1G',min_memory='1G',max_iops=10000,min_iops=1000,max_session_num=10000,max_disk_size='1024G';

create resource pool my_pool unit='S1C1G' ,unit_num=1;

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';

登录租户创建业务数据库

obclient -h127.1 -uroot@obmysql#obce-single -P2883 -p -c -A test

create database dbq;

创建业务用户

create user user1@'%' identified by 'user1';

grant all privileges on *.* to user1@'%';

创建业务表

obclient -h127.1 -uuser1@obmysql#obce-single -P2883 -p -c -A dbq

create table t1(id int);

insert into t1 values(1);

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论