Elasticsearch cluster gives READTIMEOUT error

I have a elasticsearch cluster with 3 nodes. here is stats output:

{"_nodes": {"total": 3, "successful": 3, "failed": 0}}

The index has 3 shards and 2 replicas.

I use elasticsearch-dsl==7.4.0 in python django app.

ELASTIC = {
"hosts": ["hostname1:9200","hostname2:9200","hostname3:9200"],
"timeout": 10,
"max_retries": 0,
}
connections.configure(default=ELASTIC)

sometimes save to index or search elasticsearch returnes this exception:

elasticsearch.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPSConnectionPool(host='hostname2', port=9200): Read timed out. (read timeout=10))

why this happens? a cluster in elasticsearch should be highly avaliable but in my case when one of requests to nodes "times out" an exception occures.

Source: Python-3x Questions

LEAVE A COMMENT