问题描述:
- 在使用Elasticsearch的RestHightClient API 去搜索ES数据,当请求的参数过长的出现下面的异常:
{"type":"too_long_frame_exception","reason":"An HTTP line is larger than 4096 bytes."}
,默认情况下ES对请求参数设置为4K,如果遇到请求参数长度限制可以在elasticsearch.yml中修改如下参数:
http.max_initial_line_length:
"8k"
http.max_header_size:
"16k"
- org.elasticsearch.common.netty.handler.codec.frame.TooLongFrameException: HTTP content length exceeded 104857600 bytes.
Update: I increased size in /etc/elasticsearch/elasticsearch.yml and it works again
# Set a custom allowed content length:
#
http.max_content_length: 500mb
具体的参数配置链接:
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html