1、环境介绍
2、docker介质下载:
3、安装docker图形化软件
4、docker安装完成之后,Docker启动遇到Starting the Docker Engine的问题如下图:
该问题通过如下办法可以解决:
更新wsl
wsl --update
更新完成之后执行wsl -l -v 如下
5、docker可以正常启动
检查DOCKER版本:
6、搜索oceanbase镜像
7、拉取oceanbase 镜像
根据视频讲解拉取该镜像oceanbase/obce-mini
结果拉取不到该镜像。
我实验拉取的是这个镜像:obpilot/oceanbase-ce
8、启动容器
9、进入容器查看集群状态
查看容器,进入对应的OB容器内
使用obd命令查看集群信息,状态为已部署,还未start
使用obd命令启动集群:
集群正常启动,但是fs.fs-aio-max-nr当前之为65535需要设置1048576
10、登录数据库创建规格、资源池和租户
obclient -h127.0.0.1 -P2883 -uroot -prootPWD123 -Doceanbase -A
obclient [oceanbase]> CREATE RESOURCE UNIT unit1 MAX_CPU 2, MEMORY_SIZE '1G', MAX_IOPS 1280,LOG_DISK_SIZE '10G', MIN_IOPS=1024; Query OK, 0 rows affected (0.012 sec)
obclient [oceanbase]> obclient [oceanbase]> obclient [oceanbase]> obclient [oceanbase]> obclient [oceanbase]> create resource pool unit=unit1 ,unit_num=1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '=unit1 ,unit_num=1' at line 1 obclient [oceanbase]> create resource pool unit='unit1' ,unit_num=1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '='unit1' ,unit_num=1' at line 1 obclient [oceanbase]> CREATE RESOURCE POOL pool1 -> UNIT ='unit1' -> UNIT_NUM =1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'UNIT_NUM =1' at line 3 obclient [oceanbase]> obclient [oceanbase]> obclient [oceanbase]> create resource pool pool unit='unit1',unit_num=1; ERROR 1235 (0A000): unit MEMORY_SIZE less than __min_full_resource_pool_memory not supported |
上面的意思,创建的规格内存小于隐含参数要求的最小内存,因此创建资源池失败。
查看隐含参数的值,隐含参数直接show不出来,需要查询试图如下:
修改该值为1G:
在来创建资源池
obclient [oceanbase]> create resource pool pool1 unit_num=1,unit='unit1'; ERROR 4733 (HY000): zone 'zone1' resource not enough to hold 1 unit. You can check resource info by views: DBA_OB_UNITS, GV$OB_UNITS, GV$OB_SERVERS. server '"127.0.0.1:2882"' LOG_DISK resource not enough
obclient [oceanbase]> select * from DBA_OB_UNITS; |
成功创建了资源池
下一步创建租户
11、在业务租户里面创建表和数据
登录到test租户中,修改用户root的密码。
创建表和插入数据且查出结果: