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 個月前檢視次數 173 次
1 個回答
4
已接受的答案

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

已回答 1 個月前
AWS
支援工程師
已審閱 20 天前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南