「Elasticsearch」- 常见错误列表

  FROM JENKINS AUTOMATION

更新日期:2019年09月11日

#3 java.lang.OutOfMemoryError: Java heap space

-「Setting the heap size
-「Elasticsearch service failing

问题描述:
服务挂了,看日志,而java.lang.OutOfMemoryError: Java heap space是最后一条日志。

问题原因:
内部太少了。

解决方案:
系统为CentOS 7.5,Elasticsearch 6.3.2,修改/etc/sysconfig/elasticsearch文件中的ES_JAVA_OPTS="-Xms6000m -Xmx6000m",然后重启服务。

#2 cluster_block_exception blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]

-「Elasticsearch error: cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)], flood stage disk watermark exceeded

问题描述:
执行操作时,产生如下错误:

{
	"error": {
		"root_cause": [
			{
				"type": "cluster_block_exception",
				"reason": "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
			}
		],
		"type": "cluster_block_exception",
		"reason": "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
	},
	"status": 403
}

问题原因:
当Elasticsearch认为磁盘空间不足时会发生这种情况,因此它会将自身置于只读模式。

解决办法:

PUT /_all/_settings
{
	"index.blocks.read_only_allow_delete": null
}

#1 Result window is too large…


“reason”: {

“type”: “query_phase_execution_exception”,
“reason”: “Result window is too large, from + size must be less than or equal to: [1000] but was [13100]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.”

}

问题原因:
使用了Easticsearch中的「From / Size」方式进行数据分页会导致这个问题。官方文档有说”Note that from + size can not be more than the index.max_result_window index setting which defaults to 10,000“。如果你一定要使用这种分页方式,那么需要修改index.max_result_window的值。

解决办法:

PUT /<your index name>/_settings
{
    "index": {
        "max_result_window": "100000000"
    }
}

官方说明:
Elasticsearch Reference [6.5] » Search APIs » Request Body Search » From / Size

相关文章

Elasticsearch “Yellow” cluster status explained



Backlinks:
00.INDEX


文章摘要:Operations_Engineer:3.Logging:Elastic_Stack:1.Elasticsearch_-_Search_and_Analytics:z.Error_List_(Elasticsearch)

原文链接:「Elasticsearch」- 常见错误列表