问题
I followed all the steps mentioned on here
to connect to Redshift through Workbench J.
I am not using SSH to connect, so have left SSH settings alone.
When I select Security after selecting Redshift, I see :
Your account does not support the EC2-Classic Platform in this region. Cluster Security Groups are only available when the EC2-Classic Platform is supported. Instead, use VPC Security Groups to control access to your clusters. Go to the EC2 Console to view your VPC Security Groups. For more information, see Amazon Redshift Documentation on Supported Platforms and Managing Clusters in VPC.
My cluster is under a Security Group which has the following Inbound rule :
Type: Redshift
Protocol: TCP
Port Range: 5439
Source: Custom 0.0.0.0/0 (Experimental, just to test,
I will replace this with my IP address)
When I do a Netstat on the host from my machine with -Pn. I get a
Host is up.
PORT STATE SERVICE
5439/tcp filtered unknown
Nmap done: 1 IP address (1 host up) scanned in 2.22 seconds
I have already gone through several similar questions and none of these is working for me.
回答1:
Double check your Security Group settings:
- In the Redshift console, go to the
Configurationtab. - Click on the link next to
VPC security groups- Should take you to
Security Groupsin the EC2 console with the correct security group selected.
- Should take you to
- Select the
Inboundtab for the security group and click theEditbutton (a dialog box opens). - In the dialog box, click the
Add Rulebutton then:- Select
Redshiftfrom theTypedropdown menu - Select
Anywherefrom theSourcedropdown menu- Come back and change this to
My Iponce your connection works!
- Come back and change this to
- Click the
Savebutton (the dialog closes) - You now have 2 new Redshift rules (
0.0.0.0/0AND::/0)
- Select
Then in SQL Workbench's "Select Connection Profile" dialog:
- Click "Manage Drivers" at the bottom left and to add the Redshift JDBC driver.
- SQL Workbench configures these automatically but check that
Classnameis likecom.amazon.redshift.jdbc42.DriverandSample URLisjdbc:redshift://host:port/name_of_database.
- SQL Workbench configures these automatically but check that
- Next, configure the connection
- Select the new
Driveryou just created from the drop down. - Copy the
JDBC URLfrom the Redshift console Configuration tab and paste it into theURLfield.- Must use the correct port:
jdbc:redshift://my-cluster.asdfgh5jk8.us-east-1.redshift.amazonaws.com:5439/my-db
- Must use the correct port:
- Add your
UsernameandPassword - Test the connection! (Bottom right)
- Select the new
Please let me know in the comments if this doesn't work for some reason and I'll help you get it working.
来源:https://stackoverflow.com/questions/44335761/amazon-500150-unable-to-connect-to-redshift-cluster