连接到Redshift时AWS无服务器Lambda超时 [英] AWS Serverless lambda times out while connecting to redshift

查看:83
本文介绍了连接到Redshift时AWS无服务器Lambda超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从AWS lambda连接到redshift时,我一直处于超时状态.

I am getting constant timeout while connecting from AWS lambda to redshift.

我从python代码中获得了Timeout异常

I get Timeout exception from my python code

我已经添加了vpc部分:

I have already added the vpc section:

  vpc:
    securityGroupIds:
      - sg-xxxxxxx
    subnetIds:
      - subnet-xxxxxxx

那么这里发生了什么事?

So whats happenign here?

推荐答案

要解决此问题,可以使用以下步骤;

To troubleshoot this issue, you can use following steps;

  1. 使用 VPC可达性分析器:使用Source类型的网络接口和Source作为您的AWS Lambda的网络接口ID创建和分析路径.此外,选择目标类型"作为网络接口",然后选择目标"作为AWS Red Shift的网络接口ID.将目标端口"设置为5439或使用的通信端口,将协议"设置为TCP.
  1. Use VPC Reachability Analyzer : Create and analyze path with Source type Network Interfaces and Source as Network Interface Id of the your AWS Lambda. Furthermore, select Destination type as Network Interfaces and Destination as network Interface Id of the AWS Red Shift. Put Destination port as 5439 or the communication port you are using, keep Protocol as TCP.

注意:此路径分析需要几分钟的时间.*

Note: It takes few minutes for completion of this path analysis.*

OR

  1. 如果您已启用
  1. If you have enabled VPC Flow Logs, then you can trace vpc flow logs to check, which AWS resource is rejecting the network traffic.

注意:在AWS CloudWatch中加载vpc网络流日志需要花费几分钟的时间

这篇关于连接到Redshift时AWS无服务器Lambda超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆