
第七期征文正在进行中,欢迎滑至文章底部查看详情

陈旭(大表哥)
作者介绍
01.

02.


03.
源端 MySQL
root@localhost:mysql_uatDB.sock [performance_schema]> create database db_oms_test ;--------------create database db_oms_test--------------Query OK, 1 row affected (0.01 sec)
root@localhost:mysql_uatDB.sock [performance_schema]> use db_oms_testDatabase changedroot@localhost:mysql_uatDB.sock [db_oms_test]> create table t_oms_tab(id int primary key, name varchar(200));--------------create table t_oms_tab(id int primary key, name varchar(200))--------------Query OK, 0 rows affected (0.01 sec)root@localhost:mysql_uatDB.sock [db_oms_test]> insert into t_oms_tab values (1,'mysql 8.0 to OB4.0 via OMS');--------------insert into t_oms_tab values (1,'mysql 8.0 to OB4.0 via OMS')--------------Query OK, 1 row affected (0.00 sec)root@localhost:mysql_uatDB.sock [db_oms_test]> commit;--------------commit--------------Query OK, 0 rows affected (0.00 sec)
OMS 需要写入心跳的信息到源端数据库 drc 里面,我们需要手动创建 database drc.
root@localhost:mysql_uatDB.sock [performance_schema]> create user app_oms_test@'%' identified with mysql_native_password by '1234_abcD';--------------create user app_oms_test@'%' identified with mysql_native_password by '1234_abcD'--------------Query OK, 0 rows affected (0.01 sec)root@localhost:mysql_uatDB.sock [performance_schema]> grant all on db_oms_test.* to app_oms_test@'%';--------------grant all on db_oms_test.* to app_oms_test@'%'--------------Query OK, 0 rows affected (0.01 sec)root@localhost:mysql_uatDB.sock [db_oms_test]> GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO app_oms_test@'%' WITH GRANT OPTION;--------------GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO app_oms_test@'%' WITH GRANT OPTION--------------Query OK, 0 rows affected (0.01 sec)root@localhost:mysql_uatDB.sock [db_oms_test]> create database drc;--------------create database drc--------------Query OK, 1 row affected (0.01 sec)root@localhost:mysql_uatDB.sock [db_oms_test]> grant all on drc.* to app_oms_test@'%';--------------grant all on drc.* to app_oms_test@'%'--------------Query OK, 0 rows affected (0.01 sec)
目标端 OceanBase 4.0
obclient [oceanbase]> CREATE resource unit mysqlunit max_cpu=2, min_cpu=1, MEMORY_SIZE='1G', min_iops=1024, LOG_DISK_SIZE='2G';Query OK, 0 rows affected (0.006 sec)
3. 创建资源池
CREATE resource pool app_pool unit = 'mysqlunit', unit_num = 1, ZONE_LIST = ('zone1','zone2','zone3');
CREATE TENANT IF NOT EXISTS tenant_mysql_test charset='utf8mb4', comment 'mysql tenant/instance', primary_zone='RANDOM', resource_pool_list = ('app_pool') set ob_tcp_invited_nodes = '%';
[oceanbase@whdrcsrv403 ~]$ obclient -h10.25.15.83 -P2881 -uroot@tenant_mysql_test -Doceanbase -AWelcome to the OceanBase. Commands end with ; or \g.Your OceanBase connection id is 3221601564Server version: OceanBase_CE 4.0.0.0 (r100000272022110114-6af7f9ae79cd0ecbafd4b1b88e2886ccdba0c3be) (Built Nov 1 2022 14:57:18)Copyright (c) 2000, 2018, OB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.obclient [oceanbase]> create user app_oms_account identified by "12345678";Query OK, 0 rows affected (0.137 sec)obclient [oceanbase]> create database db_oms_test ;Query OK, 1 row affected (0.149 sec)obclient [oceanbase]> grant all on *.* to app_oms_account;Query OK, 0 rows affected (0.062 sec)
04.
Source 数据源:MySQL 8.0

2. 我们创建一个名字叫 SOURCE_MYSQL8.0 的数据源


Target 数据源:OceanBase 4.0 社区版


04.
创建迁移任务
创建任务
源端选择:SOURCE_MYSQL8.0 目标端选择:TARGET_OB4.0 场景类型:仅支持还有唯一键的表(由于我们的源端 MySQL 是 MGR 的架构,默认的表必须是 innoDB 存储引擎+必须带有主键,所以可以放心大胆的勾选)

同步方式

迁移对象
然后点击校验,可以进行对象的合法性验证。

迁移配置
增量保留时间, OMS 有一个 store 组件会实时抓取源端 MySQL 的 binlog, 并保留一段时间。
高级设置保持默认就行。

全局检查

启动任务








05.
总结
问题1 . OMS 上创建 OceanBase 的数据源报错 :集群名称不存在


问题2 . 启动同步任务报错:OMS 集群内机器部分资源指标超出系统阈值


问题3 . 运行同步任务的时候报错:查询超时

问题4 . 之前的步骤执行失败, store 变成停止的状态


问题5 . OMS 网站平台响应很慢
# 动态更新 OMS 社区版容器可用 CPU 到 4C[root@whdrcsrv403 ~]# docker update 52dcc0486b89 --cpu-quota 40000052dcc0486b89# 动态更新 OMS 社区版容器可用内存到 16G[root@whdrcsrv403 ~]# docker update 52dcc0486b89 --memory 16G --memory-swap 16G52dcc0486b89
[root@whdrcsrv403 ~]# docker restart 52dcc0486b8952dcc0486b89
OceanBase 联合墨天轮技术社区,共同启动 第七期技术征文活动「小鱼快跑|OceanBase 4.1 上手体验」,欢迎广大数据库开发者畅谈 OceanBase 4.1。
无论你是数据工程师、DBA、应用开发者、架构师,还是其他数据库厂商的用户,又或是对数据库充满兴趣的爱好者,我们都期待你的参与,期待“小鱼”能成为你的朋友。
除了稿酬、证书,我们还特别为本次征文活动准备了树莓派、运动手环、徽章等限定周边,快来参与吧~

参加第七期技术征文

文章转载自OceanBase数据库星球,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。





