Connection Timeout with Elasticsearch

前端 未结 9 2065
刺人心
刺人心 2020-12-04 21:01
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()

doc = {
    \'author\': \'kimchy\',
    \'text\': \'Elasticsearch: cool.          


        
9条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 21:05

    The reasons for the timeout could be many and it seems worth checking the logs on elasticsearch side (logs/elasticsearch.log) to see the detailed error. In our case, the error on ES was:

    primary shard is not active Timeout: [1m]
    

    As described in this post, this was because our disk was full. We had resized it (and the partition) a day ago to take care of that but ES needs to be restarted if the high/low watermark has been hit once (we are on 5.5.x) which we had not done.

    Simply restarting the ES on production resolved the issue for us.

提交回复
热议问题