I tried to execute the below python code
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
es.indices.create(index='my-index', ignore=400)
The last statement through the below connection error.
ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at
0x0000020DC5EEF6D8>: Failed to establish a new connection: [WinError 10061] No
connection could be made because the target machine actively refused it) caused
by: NewConnectionError(<urllib3.connection.HTTPConnection object at
0x0000020DC5EEF6D8>: Failed to establish a new connection: [WinError 10061] No
connection could be made because the target machine actively refused it)

elasticsearch:9200?