Connection Timeout with Elasticsearch

前端 未结 9 2073
刺人心
刺人心 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:12

    The connection timed out problem could occur if you are using Amazon Elastic Search service.

    es = Elasticsearch([{'host': 'xxxxxx.us-east-1.es.amazonaws.com', 'port': 443,  'use_ssl': True}])
    

    The above python code where you override the default port from 9200 to 443 and setting the SSL to true will resolve the issue.

    If no port is specified, it is trying to connect to the port 9200 in the specified host and fails after time out

提交回复
热议问题