Node.js AWS Elasticsearch不返回活动连接
大家好,我正在使用AWS Elasticsearch服务,并使用Lambda访问它。当我尝试从Lambda连接elasticsearch时,它抛出了一个错误Node.js AWS Elasticsearch不返回活动连接,node.js,amazon-web-services,
elasticsearch,aws-elasticsearch,Node.js,Amazon Web Services,
elasticsearch,Aws Elasticsearch,大家好,我正在使用AWS Elasticsearch服务,并使用Lambda访问它。当我尝试从Lambda连接elasticsearch时,它抛出了一个错误 { Error: No Living connections at sendReqWithConnection (/var/task/node_modules/elasticsearch/src/lib/transport.js:226:15) at next (/var/task/node_modules/elastics
{ 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 }
我正在使用nodejso连接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;
我已经在另一个帐户上测试过了,它运行良好,会出现什么问题,
感谢阅读。您的代码是否真的将主机设置为
端点地址
,或者您为帖子更改了某些内容?很抱歉,实际上它的elasticsearch端点,是的,是为帖子设置的。如果其他帐户工作正常,那么可能该帐户的lambda函数没有访问ES端点的权限。