数据同步
1、es配置
查询集群名称
http://{ip}:9200/_cluster/health?pretty
如图所示:
创建es映射文件
es文件夹下的创建t_user.yml文件
代码如下:
1 2 3 4 5 6 7 8 9 | dataSourceKey: defaultDS destination: example groupId: g1 esMapping: _index: user _type: _doc _id: id sql: "select u.id,u.name,u.phone,u.gender,u.create_time from t_user u" commitBatch: 3000 |
如图所示:
根据获取的数据结构
GET my_test_index/_search { "query": { "match_all": {} } } PUT /my_test_index { "settings": { "number_of_shards": "1", "number_of_replicas": "0" }, "mappings": { "properties": { "id": { "type": "long" }, "name": { "type": "text" }, "createtime": { "type": "date" } } } } DELETE /my_test_index?pretty POST /my_test_index/_doc/1 { "id": 2, "name": "stono2", "createtime": "1999-11-11" }
如图所示
点到为止
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
2019-02-25 五、core开发
2019-02-25 三、oneinstack
2019-02-25 二、两条Linux删除数据跑路命令
2019-02-25 一、定时任务