How to Fix Read timed out in Elasticsearch

后端 未结 7 1372
执念已碎
执念已碎 2020-12-25 10:33

I used Elasticsearch-1.1.0 to index tweets. The indexing process is okay. Then I upgraded the version. Now I use Elasticsearch-1.3.2, and I get this message randomly:

<
7条回答
  •  [愿得一人]
    2020-12-25 11:24

    Its hard to give a direct answer since the error your seeing might be associated with the client you are using. However a solution might be one of the following:

    1.Increase the default timeout Globally when you create the ES client by passing the timeout parameter. Example in Python

    es = Elasticsearch(timeout=30)
    

    2.Set the timeout per request made by the client. Taken from Elasticsearch Python docs below.

    # only wait for 1 second, regardless of the client's default
    es.cluster.health(wait_for_status='yellow', request_timeout=1)
    

    The above will give the cluster some extra time to respond

提交回复
热议问题