【问题标题】:AWS OpenSearch client error: unable to verify that the server is ElasticsearchAWS OpenSearch 客户端错误:无法验证服务器是 Elasticsearch
【发布时间】:2021-11-24 20:17:20
【问题描述】:

我正在尝试编写一个 lambda 来从 OpenSearach 域获取数据。

const { Client } = require('@opensearch-project/opensearch');
const { createAWSConnection, awsGetCredentials } = require('@acuris/aws-es-connection');

const test = async () => {

    const awsCredentials = await awsGetCredentials();
    const AWSConnection = createAWSConnection(awsCredentials);
    const client = new Client({
        ...AWSConnection,
        node: 'https://<domain-name>.us-east-2.es.amazonaws.com'
    });

    // inside async func
    await client.cat.help();
};
test();

错误:

(node:32926) ProductNotSupportedSecurityError: The client is unable to verify that the server is Elasticsearch due to security privileges on the server-side. Some functionality may not be compatible if the server is running an unsupported product.

【问题讨论】:

  • 你找到解决办法了吗?
  • 我还没有测试任何答案,目前正在使用 rest apis...
  • 好的。您是否尝试在 AWS 上创建用户并将该用户添加到具有 aws elasticsearch 访问策略的组?这是使用正确的凭据。
  • 如果您使用细粒度的访问控制,您可以参考这个博客:antstack.io/blog/getting-started-with-open-search 或者对于常规访问是的,IAM 权限可以工作,

标签: amazon-web-services elasticsearch opensearch


【解决方案1】:

我遇到了同样的错误,但我使用了@elasticsearch lib 而不是@opensearch-project。也许你也可以试试。 通过降级 @elasticsearch lib 版本解决了错误。

【讨论】:

  • 你能告诉你使用的版本吗?
【解决方案2】:

尝试使用 Elasticsearch 客户端版本 7.13.0。 据docs称,它是兼容OpenSearch的最新Elasticsearch客户端。

【讨论】:

    猜你喜欢
    • 2016-01-27
    • 2014-06-29
    • 1970-01-01
    • 1970-01-01
    • 2010-11-20
    • 2011-04-30
    • 2019-09-08
    • 1970-01-01
    相关资源
    最近更新 更多