Redshift connection fails

0

Trying to connect to redshift database in python shell jobs. Tried with packages like psycopg2, redshift connector and pg. All of them gave similar error, hence I'm assuming problem is to establish connection. I have my cluster publicly accessible and unblocked elastic ip address of redshift for port 5439 in security group. Still getting same error , would appreaciate any help. ps: I have vpc attached to cluster and this has route table with internet gateway Error details : InternalError: could not connect to server: Connection timed out Is the server running on host "workgroup.123.eu-central-1.redshift-serverless.amazonaws.com" (3.33.22.33) and accepting TCP/IP connections on port 5439?

1 Answer
4
Accepted Answer

Hello,

could you please look into solution it will be helpful to you.

Check Security Group: Ensure that your Redshift cluster's security group allows inbound traffic on port 5439 from the IP address or range where your Python shell jobs are running.

Verify Public Accessibility: Double-check that your Redshift cluster is set to publicly accessible in the AWS Redshift console.

Confirm Endpoint: Use the correct endpoint for your Redshift cluster in your connection string.

Test Connectivity: Attempt to connect to your Redshift cluster using a database client like DBeaver or psql from the same network where your Python shell jobs are running to confirm if the issue is specific to your Python environment.

Check VPC and Subnet Configuration: Ensure that your VPC has an internet gateway configured in its route table, and if your Redshift cluster is in a private subnet, confirm that it has a NAT Gateway or NAT Instance for outbound internet access.

here if you get more information go through the AWS Documents Link. https://docs.aws.amazon.com/redshift/latest/mgmt/connecting-refusal-failure-issues.html https://docs.aws.amazon.com/redshift/latest/mgmt/troubleshooting-connections.html

answered 12 days ago
AWS
SUPPORT ENGINEER
reviewed 6 days ago
profile picture
EXPERT
reviewed 12 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions