alibaba / DataX

DataX是阿里云DataWorks数据集成的开源版本。
Other
15.96k stars 5.44k forks source link

elasticsearch 插件报错 org.apache.http.client.ClientProtocolException #38

Open wjn161 opened 6 years ago

wjn161 commented 6 years ago

配置:

{
"writer": {
      "parameter": {
        "dynamic": false,
        "indexType": "default",
        "cleanup": false,
        "accessKey": "elastic",
        "index": "ordertest",
        "settings": {
          "index": {
            "number_of_replicas": "1",
            "number_of_shards": "5"
          }
        },
        "column": [
          {
            "name": "id",
            "type": "long"
          },
          {
            "name": "order_id",
            "type": "long"
          },
          {
            "name": "merchant_id",
            "type": "long"
          },
          {
            "name": "order_name",
            "type": "text"
          },
          {
            "name": "gmt_create",
            "type": "date"
          },
          {
            "name": "gmt_modify",
            "type": "date"
          }
        ],
        "batchSize": 1000,
        "accessId": "elastic",
        "discovery": false,
        "endpoint": "es-cn-4590i74hi000awxw9.elasticsearch.aliyuncs.com",
        "splitter": ","
      },
      "plugin": "elasticsearch"
    }
}

异常信息:

经DataX智能分析,该任务最可能的错误原因是:
com.alibaba.datax.common.exception.DataXException: Code:[ESWriter-03], Description:[mappings错误.].  - org.apache.http.client.ClientProtocolException
    at com.alibaba.datax.common.exception.DataXException.asDataXException(DataXException.java:26)
    at com.alibaba.datax.plugin.writer.elasticsearchwriter.ESWriter$Job.prepare(ESWriter.java:76)
    at com.alibaba.datax.core.job.JobContainer.prepareJobWriter(JobContainer.java:947)
    at com.alibaba.datax.core.job.JobContainer.prepare(JobContainer.java:391)
    at com.alibaba.datax.core.job.JobContainer.start(JobContainer.java:165)
    at com.alibaba.datax.core.Engine.start(Engine.java:96)
    at com.alibaba.datax.core.Engine.entry(Engine.java:184)
    at com.alibaba.datax.core.Engine.main(Engine.java:217)
fang358229166 commented 6 years ago

楼主问题解决了么。。

MoonChaserChen commented 5 years ago

我遇到了同样的问题,最后发现是我es端口配置错误,datax的endpoint需要配置http端口,然而我在配置中使用了ftp端口,是连接失败导致出现了:[mappings错误] datax_mappings_error.png 实际上在ESWriter:67检查index是否存在时就已经报错了,最后抛的异常却与mappings有关(这有点疑惑)

chenjun1206 commented 5 years ago

楼主问题解决了么。。