0

I created a redshift in aws console. the I went to cluster created and based on the information I got in the console I used them in SQL Workbench/J. To set up sql workbench/J I used the following:

https://docs.aws.amazon.com/redshift/latest/mgmt/connecting-using-workbench.html

So here is my setup:

enter image description here

Now when I try to connect to it I get the following:

enter image description here

Any idea how I can fix it or what is going on?

UPDATE

I also gave inbound security group of the VPC which I had my redshift in full access to the IP address I am conncting and the same issue

Also here is the full logs:

  2018-01-18 16:39:36 ERROR Error connecting to the database using 
  URL=jdbc:redshift://hamedtest.cb1dy4xxxxxxxxxxx [Amazon](500150) Error 
   setting/closing connection: Connection timed out: connect. [SQL 
   State=HY000, DB Errorcode=500150] 
     java.sql.SQLException: [Amazon](500150) Error setting/closing 
   connection: Connection timed out: connect.
   at com.amazon.redshift.client.PGClient.connect(Unknown Source)
at com.amazon.redshift.client.PGClient.<init>(Unknown Source)
at com.amazon.redshift.core.PGJDBCConnection.connect(Unknown Source)
at com.amazon.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
at com.amazon.jdbc.common.AbstractDriver.connect(Unknown Source)
at com.amazon.redshift.jdbc.Driver.connect(Unknown Source)
at workbench.db.DbDriver.connect(DbDriver.java:513)
at workbench.db.ConnectionMgr.connect(ConnectionMgr.java:255)
at workbench.db.ConnectionMgr.getConnection(ConnectionMgr.java:182)
at workbench.gui.components.ConnectionSelector.doConnect(ConnectionSelector.java:22
7)
 Caused by: com.amazon.support.exceptions.GeneralException: [Amazon](500150) 
  Error setting/closing connection: Connection timed out: connect.
Hamed Minaee
  • 2,190
  • 3
  • 22
  • 55

1 Answers1

3

Did you choose "Publicly accessible" YES (radio button) when creating your cluster? If that is set to NO then you can only access the cluster from inside your VPC.

You easily change this in the console by navigating to the cluster, clicking the Cluster ˅ button, clicking Modify. Then change the "Publicly accessible" selection and click the blue Modify button.

Joe Harris
  • 12,009
  • 3
  • 42
  • 52
  • 1
    Good to know thanks I never noticed that but when I checked now it is publicly accessible – Hamed Minaee Jan 19 '18 at 17:54
  • In reality I wouldnt make it publicly accessible though. Instead, focus on accessing it either through a secure VPN or tunnel, or a mixture of both. After that has been set you can use port forwarding to do the connect. – dr_dronych May 13 '20 at 05:30