配置如下:
dataSourceKey: defaultDS destination: dbastatinfo groupId: g1 esMapping: _index: dbastatinfo _type: _doc pk: _id sql: "select a.iGId as _id, a.inip from processlistinfo a" commitBatch: 1000
这么写,能拿到解析的数据,但是不能写到ES中。
日志如下:
2019-04-19 14:46:41.961 [pool-4-thread-1] DEBUG c.a.otter.canal.client.adapter.es.service.ESSyncService - DML: {"data":[{"id":7571826,"iGId":"1111","inip":"xxxx","port":1111,"iRole":"slave","proid":5073476,"USER":"xxxx","HOST":"xxxx","DB":"xxxx","COMMAND":"Sleep","TIME":39,"STATE":"","INFO":"None","addTime":1555524615000,"addDate":1555516800000,"version":"20190418021001","note":""}],"database":"xxxx","destination":"dbastatinfo","es":1555524615000,"groupId":null,"isDdl":false,"old":null,"pkNames":["id"],"sql":"","table":"processlistinfo","ts":1555656400212,"type":"INSERT"}
如果使用:
dataSourceKey: defaultDS destination: dbastatinfo groupId: g1 esMapping: _index: dbastatinfo _type: _doc _id: _id sql: "select a.iGId as _id, a.inip from processlistinfo a" commitBatch: 1000
则可正常写入。
求问:ES自动分配_id时,pk的配置应该怎么写?
原提问者GitHub用户Mysia
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。