惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
B
Blog RSS Feed
Last Week in AI
Last Week in AI
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Security Blog
Microsoft Security Blog
博客园 - 三生石上(FineUI控件)
Y
Y Combinator Blog
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
雷峰网
雷峰网
C
Check Point Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园 - 司徒正美
U
Unit 42
量子位

博客园 - 反骨少年

cursor使用 wpf 进度条 https://docs.ultralytics.com/zh/tasks/detect/#export 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 vue 前端导出excel 通过outxml 复制sheet ,不完整 vue+.netCore 下载导出文件 SVN提交过滤忽略的文件 博文阅读密码验证 - 博客园 OpenTelemetry 博文阅读密码验证 - 博客园 vue3+ElementPlus 后台布局搭建 IdentityServer4 canal管理 Canal数据同步Kafka Xcode的思想,以及能让我学习的规范 阿里云的CICD
数据同步
反骨少年 · 2022-02-25 · via 博客园 - 反骨少年

1、es配置

 查询集群名称

http://{ip}:9200/_cluster/health?pretty

如图所示:

 创建es映射文件

es文件夹下的创建t_user.yml文件

代码如下:

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"
}

如图所示