0
Good afternoon!
I’m trying to connect in Elasticsearch, but I’m not getting, I don’t know if I need to inform anything else in class es=Elasticsearch(..)
# Import Elasticsearch package
from elasticsearch import Elasticsearch
es=Elasticsearch([{'host':'https://elk-site.....com.br','port':9200}])
print(es.info())
Exception occurred: Connectionerror Connectionerror(<urllib3.connection.Httpconnection Object at 0x04EEC6B8>: Failed to Establish a new Connection: [Errno 11001] getaddrinfo failed) caused by: Newconnectionerror(<urllib3.connection.Httpconnection Object at 0x04EEC6B8>: Failed to Establish a new Connection: [Errno 11001] getaddrinfo failed) File "C: Ecommerce Projects website Infrastructure ELK Servico Save.py", line 9, in print (es.info())
When accessing the url it brings the normal data.
Are you using a redirector (NGINX type)? Based on what you posted, the Python script vc is using the TCP port 9200 and accessing the standard port by the browser, ie TCP 80. Change the script to
es=Elasticsearch([{'host':'https://elk-site.....com.br','port':80}])
– Paulo Marques
@Paulomarques misses that very thing vlw
– Marco Souza