Suppose you created a single-node Redshift Cluster. When you are trying to connect this cluster from an SQL workbench, an error is thrown that states ‘Connection Refused’. What could be the possible cause of this and how would you diagnose this error?

The possible causes for this may be the following:

  1. The cluster is not in the ‘available’ state.
  2. The cluster was created in a private subnet, and no NAT gateway is attached to this private subnet. You try to connect from outside the private subnet.
  3. The security groups associated with the clusters do not allow connections from your source IP.
  4. You use an incorrect JDBC/ODBC URL or port number for connecting to the cluster.