1

我正在尝试让 python ElasticSearch 客户端连接到通过 docker 运行的本地 OpenSearch 服务器。我无法连接并继续获取

opensearch-node1       | [2021-09-25T00:09:09,526][ERROR][o.o.s.s.h.n.SecuritySSLNettyHttpServerTransport] [opensearch-node1] Exception during establishing a SSL connection: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record:

按照这些说明https://opensearch.org/downloads.html在本地安装 OpenSearch

尝试了各种方法让 python 客户端连接,但都失败了。

# es = Elasticsearch(timeout=600, hosts="http://localhost:9200", http_auth=('admin', 'admin'), use_ssl=False, verify_certs=False)
es = Elasticsearch(timeout=600, hosts=["http://localhost:9200"])
es.ping()

蟒蛇版本:3.9.7

ElasticSearch python 库:7.15.0

有没有人经历过这个?

**** 弄清楚了 ****

根据文档 opensearch.org/docs/clients/index,需要有一个至多 7.13.4 的客户端

并且根据这个问题github.com/opendistro-for-elasticsearch/sample-code/issues/242,必须像这样为本地开发者启动客户端

es = Elasticsearch(['https://admin:admin@localhost:9200/'], 
                   use_ssl=False,
                   verify_certs=False,
                   ssl_show_warn=False)
4

0 回答 0