Hi everyone! I have some questions about segments merge in elasticsearch.
Currently, the index I'm trying to merge is a single node index and is about 5GB. But it has 24 segments and some of those segments only contain less than 100 docs.
- Is it recommended to force segment merges in this case? What is the recommended
max_num_segments
? How often should I force merge them? - I tried to force merge by making the index read only first but get
FORBIDDEN
error. I'm using Elasticsearch 6.6. It seems like I don't need to make it read-only for force merge, which is not the same as the official doc suggested. Any ideas?
curl -X PUT "localhost:9200/log-2019/_settings" -H 'Content-Type: application/json' -d'
{
"index": { "blocks.read_only": true}
}
'
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/5/index read-only (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/5/index read-only (api)];"}