13

I'm trying to set up a AWS Glue job and make a connection to Redshift.

I'm getting error when I set the connection type to Redshift:

"Unable to find a suitable security group. Change connection type to JDBC and retry adding your connection."

Following what was said here in these forums, I added permissions to my IAM account for role AWSGlueServiceRoleDefault:

enter image description here

I then set up the job with the matching IAM role AWSGlueServiceRoleDefault:

enter image description here

I need to store the Glue data in Redshift DB, so I chose JDBC then added a connection:

enter image description here

As soon as I choose Redshift, it complains that it cannot find a suitable security group. Why is this?

enter image description here

enter image description here

4

3 回答 3

28

我在尝试将 Glue 与 Amazon RDS (MySQL) 连接时发现了同样的问题,并按照 AWS Glue 指南 -> Setting Up a VPC to Connect to JDBC Data Stores解决了这个问题。

简而言之,您应该检查与您的 RedShift 集群关联的安全组是否允许自引用流量。

  1. 转到 RedShift 控制台并选择集群
  2. 查看集群属性部分以获取与集群关联的安全组的 ID(例如 sg-957be3ef)。
  3. 单击安全组名称以跳转到 EC2 控制台 -> 安全组部分。选择组并修改入站和出站规则,添加自引用规则以允许 AWS Glue 组件进行通信。
    • 入站规则:选择 Type= All TCP,保留默认值并在Source字段中输入安全组(即本例中的 sg-957be3ef)。
    • 出站规则:同入站规则。

希望有效!

于 2018-02-28T15:05:01.110 回答
1

您必须创建一个:

1)AWSGlueServiceRole角色和附加s3FullAccess,GlueServiceRoleRedshiftFullAccess策略。

2)检查您是否有 vpc 端点,如果没有,请创建一个 VPC 端点并确保将子网添加到路由表中。3)创建自引用安全组。

现在使用 JDBC 连接进行连接,

jdbc:type://xxxx:port/databasename

类型是redshift/postgresql/etc... xxxx: server name数据库托管的位置。

于 2018-08-28T04:57:17.537 回答
0

请改用 JDBC 连接来连接到您的 Redshift。只需确保相应的 VPC 定义了一个端点。

于 2017-10-11T05:44:43.197 回答