【问题标题】:elasticdump can't import data from fileelasticdump 无法从文件中导入数据
【发布时间】:2021-03-04 15:59:23
【问题描述】:

我尝试从 json 文件导入数据。使用这样的命令: elasticdump --input=2016-1-1-2016-7-31-2.json --output=http://localhost:9200/ 格式如下:https://github.com/taskrabbit/elasticsearch-dump/blob/master/test/seeds.json 我的备份文件索引很少。但是当我启动上面写的命令时 - 得到这样的结果: Fri, 13 Apr 2018 13:36:44 GMT | starting dump Fri, 13 Apr 2018 13:36:44 GMT | got 100 objects from source file (offset: 0) Fri, 13 Apr 2018 13:36:44 GMT | sent 100 objects to destination elasticsearch, wrote 0 Fri, 13 Apr 2018 13:36:44 GMT | got 291 objects from source file (offset: 100) Fri, 13 Apr 2018 13:36:44 GMT | sent 291 objects to destination elasticsearch, wrote 0 Fri, 13 Apr 2018 13:36:44 GMT | got 292 objects from source file (offset: 391) Fri, 13 Apr 2018 13:36:45 GMT | sent 292 objects to destination elasticsearch, wrote 0 Fri, 13 Apr 2018 13:36:45 GMT | got 293 objects from source file (offset: 683) 如果我在 URL 中或通过 --output-index={INDEX} 设置索引名称 - 文件中的所有数据都会转到该索引并按类型分隔。

我将不胜感激!

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    在您的 elasticdump 命令行中,尝试使用类型参数 --type=dataindexName 例如elasticdump --input=2016-1-1-2016-7-31-2.json --output=http://localhost:9200/myIndex --type=data

    【讨论】:

      【解决方案2】:

      使用 Docker,您可以执行以下操作:

      docker run --name es-dump --rm -ti elasticdump/elasticsearch-dump \
          --input=./2016-1-1-2016-7-31-2.json \
          --output=http://localhost:9200/2016-1-1-2016-7-31-2 \
          --type=data \
          --limit=10000
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-08-14
        • 2014-01-27
        • 2020-04-26
        • 1970-01-01
        • 1970-01-01
        • 2017-01-13
        • 2021-08-29
        相关资源
        最近更新 更多