在Windows上,我想将python程序连接到found.io上托管的elasticsearch集群(通过heroku)。
与elasticsearch的连接超时,给我一个异常(exception),说“目标机器主动拒绝了它”。
es = Elasticsearch(
[elastic],
# port=443,
use_ssl=True,
verify_certs=True,
ca_certs=certifi.where(),
)
我期望建立索引,但是收到以下错误消息:
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x03A0EC70>: 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 0x03A0EC70>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it)
最佳答案
可能是PROXY问题,例如 heroku/legacy-cli
issue 642中的问题,并记录在using the CLI / using an HTTP proxy中。
另一个原因就是当远程 flex 搜索集群未启动时(如in this thread)。
关于python - Windows上的Elasticsearch连接问题(found.io),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56330037/