简体   繁体   English

Elasticsearch::UnsupportedProductError(客户端注意到服务器不是 Elasticsearch 支持的发行版

[英]Elasticsearch::UnsupportedProductError (The client noticed that the server is not a supported distribution of Elasticsearch

Getting this error when using searchkick with elasticsearch on mac.在 mac 上将 searchkick 与 elasticsearch 一起使用时出现此错误。

Searchkick version: searchkick (4.5.2) Searchkick 版本:searchkick (4.5.2)

$ elasticsearch --version
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
Version: 7.10.2-SNAPSHOT, Build: oss/tar/unknown/2021-01-16T01:41:27.115673Z, JVM: 16.0.2

To reproduce重现

Product.reindex Product.reindex

如果您使用 Python elasticsearch 客户端,则需要降级或安装 7.14.0 之前的版本。

pip install elasticsearch<7.14.0

It worked fine after degrading to elastic search < 7.14.降级到弹性搜索 < 7.14 后它工作正常。 So basically added a gem to restrict the version upgrade所以基本上加了一个gem来限制版本升级

gem  elasticsearch, "< 7.14"

Elasticsearch::UnsupportedProductError is raised when your Elasticsearch server version don't match with Ruby's Elasticsearch client ( gem elasticsearch ).当您的 Elasticsearch 服务器版本与 Ruby 的 Elasticsearch 客户端 ( gem elasticsearch ) 不匹配时,会引发Elasticsearch::UnsupportedProductError In order to fix this properly you need a server that is up to date with latest Elasticsearch (ES) releases为了正确解决此问题,您需要一个与最新 Elasticsearch (ES) 版本保持同步的服务器

that means if you are on ES provider like https://cloud.elastic.co/ where you work with latest versions of cluster it's easy peasy => server gets upgraded => this is not an issue这意味着如果您在 ES 提供商(例如https://cloud.elastic.co/ )上使用最新版本的集群,这很容易 => 服务器升级 => 这不是问题

if you however work with provider that is slow to catch up with latest ES releases (like AWS Elasticsearch / AWS Opensearch where last version is 7.10 and will not get upgraded anytime soon) your only option is to use gem elasticsearch, "< 7.14" (Siddhant's answer in this discussion ...and yes this means no potential security updates但是,如果您与无法赶上最新 ES 版本的供应商合作(例如 AWS Elasticsearch / AWS Opensearch,其中最后一个版本是 7.10 并且不会很快升级),您唯一的选择是使用gem elasticsearch, "< 7.14" ( Siddhant在本次讨论中的回答……是的,这意味着没有潜在的安全更新

other solution may be to silence the verification by overriding method verify_with_version_or_header as proposed in https://github.com/elastic/elasticsearch-ruby/issues/1429#issuecomment-958162468其他解决方案可能是通过覆盖https://github.com/elastic/elasticsearch-ruby/issues/1429#issuecomment-958162468中提出的方法verify_with_version_or_header来使验证静音

but reality is both of this solutions are just "not recommended" workarounds.但现实是这两种解决方案都只是“不推荐”的解决方法。 The real fix is a server upgrade真正的修复是服务器升级

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM