Redshift connection issue in SQL Workbench/J

2020-06-28 13:25发布

问题:

I started learning amazon redshift, and followed its documentation for creating a cluster.

I opted for 2 months free trail. When I try to connect to the Redshift db from SQL workbench/J it says "Connection timed out error".

I checked and all the details I have entered are correct! I'm accessing the Redshift db from my laptop through corporate LAN. I think this as an issue. Tell me how to connect to Redshift from my corporate LAN connection?

The response from SQL workbench/J when I try to connect is:

[Amazon][500150] Error setting/closing connection: Connection timed out:connect.

回答1:

Check if your cluster has public access: Go to the Redshift console to see if it's "Yes" for Publicly Accessible.

Check if security group allow access from your IP. You can use "nc -v endpoint port" to check if the cluster's port is pingable.



回答2:

Go into EC2 Management Console
On the left navigation pane, look for Network & Security header and click on Security Groups. (https://us-west-2.console.aws.amazon.com/ec2/v2/home?region=us-west-2#SecurityGroups:sort=groupId)
Notice the row with name "launch-wizard-1" in the Group Name's column. Click that. Then select the Inbound tab, and click Edit.
Add Rule: Type=Redshift, Source=MyIP. (auto-fill)  [Note: Later if you want to use muliple source to connect to that cluster, say Tableau, Quick Sight, etc. I would suggest making it public)
Save it.
Try to connect again from within SQLWorkbench/J.