简体   繁体   English

弹性搜索。 无法建立新连接:[WinError 10061]

[英]Elasticsearch. Failed to establish a new connection: [WinError 10061]

After writing this code I get a connection error.编写此代码后,出现连接错误。

from elasticsearch import Elasticsearch
es = Elasticsearch()
doc = {'author': 'kimchy','text': 'Elasticsearch: cool. bonsai cool.'}
res = es.index(index="test-index", doc_type='tweet', id=1, body=doc)

Is the problem in the code or in my computer?是代码问题还是我的电脑问题? What can I do to fix it?我能做些什么来修复它?

CURL: localhost:9200 检查您的本地机器上是否正在运行弹性搜索。

I fixed it.我修好了它。 The problem was that the elasticsearch server was not running when I run the code.问题是当我运行代码时,elasticsearch 服务器没有运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Telegram 机器人无法建立新连接 [WinError 10061] - Telegram bot failed to establish a new connection [WinError 10061] 无法建立新连接:[WinError 10061]无法建立连接,因为目标计算机主动拒绝了该连接 - Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it Python请求失败,失败,无法建立新的连接错误10061 - Python requests failing with Failed to Establish new Connection Error 10061 无法建立新连接:[WinError 10060] 连接尝试失败 - Failed to establish a new connection: [WinError 10060] A connection attempt failed 如何解决python中的“无法建立新连接:[Errno 10061]”错误? - How can i fix the “Failed to establish a new connection: [Errno 10061]” error in python? Docker - Elasticsearch - 无法建立新连接:[Errno 111] Connection refused',)) - Docker - Elasticsearch - Failed to establish a new connection: [Errno 111] Connection refused',)) 建立新连接失败 - Failed to establish a new connection 无法建立新的连接错误 - Failed to establish a new connection error Selenium - 无法建立新连接 - Selenium - Failed to Establish New Connection 尝试使用 elasticsearch-dsl Python package 访问 Elasticsearch 云时“无法建立新连接” - “Failed to establish a new connection” when trying to access Elasticsearch Cloud with elasticsearch-dsl Python package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM