简体   繁体   English

Aurora 无服务器连接超时

[英]Aurora serverless connection timed out

I'm trying to connect to my aurora serverless but every time I try to do it I receive this error:我正在尝试连接到我的极光无服务器,但每次尝试连接时都会收到此错误:

2021/03/18 17:10:00 error verifying database connection is alive: dial tcp 10.247.15.113:3306: connect: operation timed out exit status 1

I created a VPC, subnets and security groups.我创建了一个 VPC、子网和安全组。

  • VPC -> 10.247.0.0/20 VPC -> 10.247.0.0/20
  • 4 Subnets -> 10.247.0.0/22, 10.247.8.0/22, 10.247.4.0/22 and 10.247.12.0/22 4 个子网 -> 10.247.0.0/22、10.247.8.0/22、10.247.4.0/22 和 10.247.12.0/22
  • Security group -> Lives inside my VPC and as inbound has port SSH 22 for 0.0.0.0/0 and MYSQL/Aurora 3306 for my EC2 instance IP address.安全组 -> 位于我的 VPC 内,入站端口为 0.0.0.0/0 的端口 SSH 22 和我的 EC2 实例 IP 地址的 MYSQL/Aurora 3306。 Outbound has all traffic出站有所有流量

Using ssh in a database client works but inside my code I receive the error I mentioned, I also tried doing telnet and I receive another operation timed out.在数据库客户端中使用 ssh 可以工作,但在我的代码中我收到了我提到的错误,我也尝试过 telnet,但我收到另一个操作超时。

I know this may be something related to the networking but not sure why since I can connect via ssh with an EC2 instance.我知道这可能与网络有关,但不知道为什么,因为我可以通过 ssh 与 EC2 实例连接。 What can it be?会是什么?

Your guide is for RDS.您的指南适用于 RDS。 It does not apply to Aurora Serverless (AS).它不适用于 Aurora Serverless (AS)。 Specifically AS can't be accessed from internet .特别是 AS不能从 internet 访问 So you can't connect to it directly from home:所以你不能直接从家里连接到它:

You can't give an Aurora Serverless v1 DB cluster a public IP address.您不能为 Aurora Serverless v1 数据库集群提供公共 IP 地址。 You can access an Aurora Serverless v1 DB cluster only from within a VPC .只能从 VPC 内访问 Aurora Serverless v1 数据库集群。

You have to connect to it from within a VPC, eg EC2 instance, ECS container or a lambda function.您必须从 VPC 中连接到它,例如 EC2 实例、ECS 容器或 lambda function。

The only way to connect to it from home is to use RDS DataAPI , or setup ssh tunnel or VPN between your home network and your VPC.从家里连接到它的唯一方法是使用RDS DataAPI ,或在您的家庭网络和 VPC 之间设置ssh 隧道或 VPN。

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

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