简体   繁体   English

Elasticsearch批量索引没有错误

[英]Elasticsearch Bulk Index no Error

I am running the code below on the cmd line (Windows) to bulk index about 3 million docs, but nothing happens. 我在cmd行(Windows)上运行下面的代码以批量索引约300万个文档,但是什么也没有发生。 I run it and one second later it is done with no output and the index is not even created. 我运行它,一秒钟后,它没有任何输出,甚至没有创建索引。

 curl -H "Content-Type: application/json" -XPOST "localhost:9200/test1/_doc/_bulk" --data-binary "@huge_JSON"

I run the same line on a few lines of this document and it works fine. 我在本文档的几行中执行了同一行,并且工作正常。

Also running it on a file with 300k documents works. 也可以在包含30万个文档的文件上运行它。

Why is it not working and not giving an error? 为什么它不起作用并且没有给出错误?

Edit: For whatever reason I now get the error: 编辑:无论出于何种原因,我现在都会收到错误消息:

curl: option --data-binary: out of memory

Split up the file (Use cygwin etc. if on Windows): 分割文件(如果在Windows上,请使用cygwin等):

split -l 100000 huge_JSON

Run this line to index each of the split files: 运行以下行以索引每个拆分文件:

for %%i in (*) do curl -H "Content-Type: application/json" -XPOST "localhost:9200/test1/_doc/_bulk?pretty&refresh" --data-binary  @%%i

OR 要么

Just use logstash 只需使用logstash

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM