【 使用环境 】生产环境
【 OB or 其他组件 】OBServer,OBlogproxy,Cloudcanal
【 使用版本 】OBServer-4.2.4,OBlogproxy2.0.2,Cloudcanal-4.4.0.0
【问题描述】使用cloudcanal同步Oceanbase租户到mysql失败,任务创建后提示如下:
Console task execute with error. Context is {“resources”:[],“tryTimes”:null,“paramType”:null,“consoleJobId”:0,“dataJobId”:9,“singleGenJob”:false}.
Exception stack is 远程获取任务初始位点失败。错误信息为:invoke rcontroller method failed.Request id:b3c8c1e2-8c2d-11ef-97b4-8d5dd374eb93msg:SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ‘master status’ at line 1. target sidecar is 172.31.238.4, route name is oceanbase_rdbFetchSrcIncrePosition
at com.clougence.cloudcanal.console.component.rsocket.service.impl.OceanBaseMetaRServiceImpl.fetchCurrentBinlogPos(OceanBaseMetaRServiceImpl.java:67)
at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.oceanbase.ObInitCdcHandler.initSrcMySqlFileBasePos(ObInitCdcHandler.java:92)
at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.oceanbase.ObInitCdcHandler.execute(ObInitCdcHandler.java:71)
at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.oceanbase.ObInitCdcHandler.execute(ObInitCdcHandler.java:38)
at com.clougence.cloudcanal.console.component.consoletask.service.ConsoleJobManagerImpl.doExecuteJob(ConsoleJobManagerImpl.java:229)
at com.clougence.cloudcanal.console.component.consoletask.service.ConsoleJobManagerImpl.lambda$doExecuteJobAsync$1(ConsoleJobManagerImpl.java:183)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
cloudcanal Oceanbase数据源已选择的是binlog模式,任务创建步骤时cloudcanal提示的名称却是cdc
错误信息 You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'master status' at line 1 表明在执行 SQL 语句时出现了语法错误。'master status' 是 MySQL 中用于获取主库状态的命令,但在 OceanBase 中可能不适用或语法不同。
obclient [(none)]> SHOW TENANT;
+---------------------+
| Current_tenant_name |
+---------------------+
| sys |
+---------------------+
1 row in set
obclient [(none)]> CREATE USER sys_user001 IDENTIFIED BY 'your_password';
Query OK, 0 rows affected
obclient [(none)]> GRANT ALL PRIVILEGES ON *.* TO sys_user001 WITH GRANT OPTION;
Query OK, 0 rows affected
obclient -h <OBServer_IP> -P <OBServer_Port> -u root@sys -p <root_password>
CREATE USER sys_user001 IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON *.* TO sys_user001 WITH GRANT OPTION;