From 77cf1effd15fea81b15ecaa07dbf716a6bf40f68 Mon Sep 17 00:00:00 2001 From: lixiaodong <329003748@qq.com> Date: Wed, 15 Dec 2021 10:25:19 +0800 Subject: [PATCH] add common error solutions to 4.7.md file (#712) --- .../ob-quick-start/chapter04/4.7.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/docs/docs/junior-training/ob-quick-start/chapter04/4.7.md b/docs/docs/junior-training/ob-quick-start/chapter04/4.7.md index 15b89f36f..5beb18c92 100644 --- a/docs/docs/junior-training/ob-quick-start/chapter04/4.7.md +++ b/docs/docs/junior-training/ob-quick-start/chapter04/4.7.md @@ -69,3 +69,94 @@ } } ``` + +## 常见报错问题解决 + ++ 1、MySQL 端 ssl 相关的报错 +```bash +Mon Dec 13 15:44:13 CST 2021 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification +``` + +可以在 jdbcurl 里关闭 ssl ,如示例: +```bash +"jdbcUrl": ["jdbc:mysql://127.0.0.1:3306/tpccdb?useUnicode=true&characterEncoding=utf8"] +调整为 +"jdbcUrl": ["jdbc:mysql://127.0.0.1:3306/tpccdb?useUnicode=true&characterEncoding=utf8&useSSL=false"] +``` + ++ 2、存在外键导入报错 +关于有外键的表进truncate的时候报错,可以使用 delete from table 代替,也可以在 prepare sql 语句里 set foreign_key_checks='off' 避免报错。 + ++ 3、导入数据时事物超时 +可以在prepare sql 中增加timeout的设置, set ob_trx_timeout=1000000000 。 + ++ 4、oceanbasev10reader 和 oceanbasev10writer 插件找不到 +说明 OceanBase 读写插件在默认的二进制 DataX 包里不存在,需要编译安装后创建对应的目录并复制相关的json文件,文件的路径和内容如下: +``` +target/datax/datax/plugin/reader/oceanbasev10reader/plugin_job_template.json +target/datax/datax/plugin/writer/oceanbasev10writer/plugin_job_template.json +``` + +```json +{ + "job": { + "content": [ + { + "reader": { + "name": "oceanbasev10reader", + "parameter": { + "column": [ + "*" + ], + "connection": [ + { + "jdbcUrl": [ + "||_dsc_ob10_dsc_||clusterName:tenantName||_dsc_ob10_dsc_||jdbc:oceanbase://obproxyIp:port/dbname" + ], + "table": [ + "tabName" + ] + } + ], + "password": "", + "readBatchSize": 100000, + "username": "", + "weakRead": false + } + }, + "writer": { + "name": "oceanbasev10writer", + "parameter": { + "column": [ + "*" + ], + "connection": [ + { + "jdbcUrl": "||_dsc_ob10_dsc_||clusterName:tenantName||_dsc_ob10_dsc_||jdbc:oceanbase://obproxyIp:port/dbname?yearIsDateType=false&ZeroDateTimeBehavior=convertToNull&tinyIntlisBit=false&rewriteBatchedStatements=true", + "table": [ + "tabName" + ] + } + ], + "obWriteMode": "insert", + "password": "", + "preSql": [ + "" + ], + "username": "" + } + } + } + ], + "setting": { + "speed": { + "channel": "" + } + } + } +} +``` + + + + -- GitLab