Search code examples
amazon-web-servicesamazon-redshiftamazon-vpcdata-pipeline

Connection error of AWS Redshift to local computer


I tried to connect Amazon Redshift to my local computer using pycopg2. However, I got an error message:

psycopg2.OperationalError: could not connect to server: Operation timed out. Is the server running on host xxx and accepting TCP/IP connecitons on posrt 5439

I have done two guides with searching google:

  1. Changed the Publicly Accessible setting as enable, and
  2. Add 0.0.0.0/0 and ::/0 to VPC route as gateway.

It still doesn't work. Please let me know if you know what the problem is.


Solution

  • Things to check:

    • Check the Security Group associated with the Redshift cluster and confirm that it permits access on port 5439 from your IP address
    • Check that the Redshift cluster was launched in a Public Subnet (with the Route Table for that subnet pointing to 0.0.0.0/0 to the Internet Gateway)
    • Make sure you are connecting by using the DNS Name (If you ping the DNS Name, does it resolve to an IP address?)
    • Try going via a different network (eg home vs office vs tethered via your phone)?