如何将 VPC 子网中的 EMR 连接到 ec2-classic 中的 redshift 实例?

How to connect EMR in VPC subnet to a redshift instance in ec2-classic?

我们有一个 不在 VPC 中的 redshift 集群,我一直在尝试从 VPC(附加互联网网关)中的 EMR 集群连接到它,但到目前为止没有成功.我想知道是否有可行的方法。

注意 - 我已经尝试在 VPC public 子网中启动一个新的 redshift 集群,并且能够从同一子网中的 EMR 连接到它。

联系 AWS 支持团队,了解到无法从 VPC 中的 EMR 连接到 ec2-classic 中的 redshift。解决方案是在 ec2-classic 中启动 EMR 或在 VPC 中恢复 redshift 集群。我们继续使用第二个选项(在 VPC 中恢复 redshift 集群),这非常简单。

在下面添加参考- https://docs.amazonaws.cn/en_us/redshift/latest/dg/load-from-emr-steps-create-cluster.html

》如果Amazon Redshift集群在一个VPC中,那么Amazon EMR集群必须在同一个VPC组中。如果Amazon Redshift集群使用EC2-Classic模式(即不在VPC中), Amazon EMR 集群还必须使用 EC2-Classic 模式

最好的方法是将 VPC 中的 Redshift 集群移动到 EMR 集群。为此,您可以拍摄快照

https://docs.aws.amazon.com/redshift/latest/mgmt/managing-snapshots-console.html#snapshot-create

的 Redshift 集群然后从快照在 VPC 中创建一个新集群

https://docs.aws.amazon.com/redshift/latest/mgmt/managing-snapshots-console.html#snapshot-restore

之后,您可以修改安全组规则,在您的Redshift集群中添加一个EMR安全组。此处概述了步骤

https://docs.aws.amazon.com/redshift/latest/mgmt/managing-security-groups-console.html#security-group-modify