不为失败找理由,要为成功找方法。

通过curl命令上传json文件

Elasticsearch | 作者 songyuzuimei1 | 发布于2019年04月10日 | 阅读数:4930

通过curl -H "Content-Type: application/json" -XPOST 'http://127.0.0.1:9200/_bulk?pretty' --data-binary @t.json上传json文件,当文件只有几k的时候成功了,但是100多M的时候就失败了,在head中没有看到索引,也没有返回错误信息!
求指教!!!!谢谢啦!
已邀请:

bellengao - 博客: https://www.jianshu.com/u/e0088e3e2127

赞同来自: songyuzuimei1

elasticsearch.yml中配置http.max_content_length参数,默认为100MB, 但是这个参数一般不要太大,太大的话会影响性能,一般来说bulk请求一次写入10MB-15MB为宜

luohuanfeng

赞同来自:

NOTE: The final line of data must end with a newline character \n. Each newline character may be preceded by a carriage return \r. When sending requests to this endpoint the Content-Type header should be set to application/x-ndjson.
 

https://www.elastic.co/guide/e ... .html

要回复问题请先登录注册