Redshift connection issue in SQL Workbench/J

4k views Asked by At

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.

3

There are 3 answers

0
Dabay Wang On

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.

0
Dinesh On

Redshift connection through SQL Workbench/J (for Windows)

Step-by-Step Guide

  1. Install SQL Workbench. (Download from https://www.sql-workbench.eu/downloads.html < Generic package for all systems including all optional libraries (sha1)) and Launch SQL Workbench.
  2. Create a Connection Profile. Select Redshift Drivers. (You can download the latest JDBC driver (JAR) from Amazon Redshift < Clusters)
  3. Configure Database Connection Details. (Use JDBC Url provided and use username, password that you created for your cluster. Click Test To Validate Connection. If success, That's it.

If you come across [Amazon][500150] Error setting/closing connection:, follow the steps:

  1. Sign-in into AWS Console
  2. Search in AWS console for 'Security groups' - You will get 'Security groups (ECS feature)'
  3. Select Inbound rules tab < select edit inbound rules (Add Rule: Type=Redshift, Source=MyIP. (auto-fill), Save it.)
  4. Also In Redshift- Open your Cluster < Actions < Modify publically accessible setting < Enable < Save Changes

Connect Redshift with SQLWorkbench/J. That's it.

0
DEEPAK LAKHOTIA On
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.