首页 > 解决方案 > AWS Elasticsearch 返回 No living Connection

问题描述

大家好,我正在使用 AWS-Elasticsearch 服务并使用 Lambda 访问它。当我尝试从 Lambda 连接弹性搜索时,它会引发错误

{ Error: No Living connections
    at sendReqWithConnection (/var/task/node_modules/elasticsearch/src/lib/transport.js:226:15)
    at next (/var/task/node_modules/elasticsearch/src/lib/connection_pool.js:214:7)
    at /var/task/node_modules/async-listener/glue.js:188:31
    at process._tickCallback (internal/process/next_tick.js:61:11)
  message: 'No Living connections',
  body: undefined,
  status: undefined }

我用Nodejs连接es域

const elasticsearch = require('elasticsearch');
const httpAwsEs = require('http-aws-es');
const AWS = require('aws-sdk');

const esClient = new elasticsearch.Client({
  host: 'endpointAddress',
  connectionClass: httpAwsEs,
  httpAuth: 'userName:Passwod',
  amazonES: {
    region: 'us-east-1',
    credentials: new AWS.EnvironmentCredentials('AWS')
  }
});

module.exports = esClient;

我已经在另一个运行良好的帐户上进行了测试,这会是什么问题,感谢阅读。

标签: node.jsamazon-web-serviceselasticsearchaws-elasticsearch

解决方案


推荐阅读