0

Tableau cannot connect to the redshift server.

It displayed:

An error occurred while communicating with Amazon Redshift

Unable to connect to the server. Check that the server is running and that you have access privileges to the requested database.

Error Code: BC42EF73

could not connect to server: Operation timed out

Is the server running on host "redshift-cluster-1.cncrnka9xarv.us-east-2.redshift.amazonaws.com" (3.143.87.206) and accepting TCP/IP connections on port 5439?

I just followed the setup in AWS Redshift Connection with Tableau - YouTube but it fails. What's the reason?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470

2 Answers2

1

The first thing you should check is the Security Group associated with the Amazon Redshift database, since the video did not reference it.

The Security Group should permit Inbound access from 0.0.0.0/0 on port 5439. Note that this makes your database accessible to anywhere on the Internet, which is not good from a security perspective. However, I couldn't find a reference to the range of IP addresses that Tableau Online uses.

If that doesn't help, then confirm that the Redshift database is in a public subnet. A public subnet is defined as having a Route Table entry pointing to an Internet Gateway.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • I can’t find the entry of managing the Security Group –  Jul 06 '21 at 06:25
  • Go to the Redshift database in the AWS management console. There will be a reference to **Security**, and a link to the Security Group should be shown. – John Rotenstein Jul 06 '21 at 06:30
  • is it i have to add an inbound rules Redshift TCP 5439 Source:0.0.0.0/0 ? –  Jul 06 '21 at 07:06
  • Yes. That will allow any IP address on the Internet to communicate with the Redshift database. Users will need the correct username and password to connect. – John Rotenstein Jul 06 '21 at 07:23
  • hi i tired again in my other account with setting Inbound rules Type:redshift protocol TCP port range 5439 source custom 0.0.0.0/0 but it seems that it fails –  Jul 08 '21 at 07:10
  • I recommend that you load an SQL client (eg DbVisualizer) and try to connect to Redshift from your own computer. That will help debug the situation, by trying to confirm whether the Redshift database is accessible from the Internet. – John Rotenstein Jul 08 '21 at 07:15
  • @JohnRotenstein This worked for me Thanks! – rahul rachh Nov 30 '21 at 02:26
0

Solving this error contains 2 steps:

  1. download the AWS redshift ODBC drive from here
  2. Follow what is given in this answer by @JohnRotenstein.

For doing that follow the following steps:

  1. Go to the cluster with which you want to establish the connection.
  2. Then go to "Properties" tab.
  3. Then below there is a section named "Network and security settings" which has "VPC security group" tab and below that there is a link that will redirect you to Security group of the VPC.
  4. Select the VPC and then select the "inbound rules" tab.
  5. There will be a security group where under "source" there will be something starting with "sg-" which means all the connections to redshift from the internet is blocked and only the addressed with this origin will be able to connect with AWS which are EC2 instances.
  6. There click on "Edit Inbound rules".
  7. In the window that opened up, click the "Add rule" button. Security group rule ID - This you do not need to set Type - All traffic Protocol - All Port range - All Source - Anywhere Ipv4(not recommended) so it will be set to "0.0.0.0/0". Description[optional]

Here set the Source to the IPaddress from where the connection request is going to be made and not the above one.

For all other connection queries can be solved by following this link

rahul rachh
  • 99
  • 1
  • 12