You need to enable JavaScript to run this app.
文档中心
数据库传输服务

数据库传输服务

复制全文
下载 pdf
故障排查
在进行 MySQL 到 ElasticSearch 的数据同步时,遇到本文介绍的报错怎么办?
复制全文
下载 pdf
在进行 MySQL 到 ElasticSearch 的数据同步时,遇到本文介绍的报错怎么办?
问题描述:当您在进行 MySQL 到 ElasticSearch 的数据同步遇到以下报错时,您可以根据本文介绍的解决方案排查问题。​
​
{​
"_index": "my-dts-index",​
"_type": "_doc",​
"_id": "20744",​
"status": 400,​
"error": {​
"type": "mapper_parsing_exception",​
"reason": "failed to parse field [update_time] of type [date] in document with id '20744'",​
"caused_by": {​
"reason": "Invalid format: \"2019-08-22 11:08:55\" is malformed at \" 11:08:55\"",​
"type": "illegal_argument_exception"​
}​
}​
}​
​
可能原因:索引my-dts-index的日期字段 update_time 的格式与 ElasticSearch 的预期格式不匹配。​
由于 MySQL 的日期字段 update_time 被设置为 2019-08-22 11:08:55,而 ElasticSearch 的日期期望的格式为 11:08:55,因此 MySQL 的日期格式和 ElasticSearch 的时间格式不一致,进而导致数据同步任务报错。​
解决方案:确保 MySQL 的日期格式符合 ElasticSearch 的期望格式。在任务结构迁移阶段配置好正确的时间格式映射,或者直接修改 ElasticSearch mapping 日期格式,DTS 结构映射默认支持的时间格式如下所示:​
  • strict_date_optional_time​
  • yyyy-MM-dd HH:mm:ss​
  • yyyy-MM-dd​
  • HH:mm:ss​
  • epoch_millis​
  • yyyy-MM-dd HH:mm:ss.SSS​
​
最近更新时间:2026.08.12 17:56:34
这个页面对您有帮助吗?
有用
有用
无用
无用