getredash / setup

Setup scripts for Redash Cloud Images
BSD 2-Clause "Simplified" License
301 stars 384 forks source link

After setup connection to local DBs fails #76

Open leschiffres opened 3 weeks ago

leschiffres commented 3 weeks ago

I have set up locally a redash instance and I try to access my local postgres instances, but connection fails. However I can access these with the same credentials from my terminal. What do I need to do, to establish connection?

justinclift commented 3 weeks ago

You'll need a few things for that to work, and it's pretty much the same list for any data source. :smile:

  1. You'll need to know the correct IP address (or dns domain name or similar) for connecting to the database

    • This can sometimes be a bit tricky if your database is running locally and only listening on (say) "localhost", which Docker containers can't easily reach
  2. The data source (PostgreSQL in this instance) has to be actually listening on that IP address and not have anything blocking incoming connections from your source IP address

    • Default firewall settings can commonly need adjusting for this bit
  3. If the data source has its own security & authentication mechanisms, these have to be configured to allow access

    • PostgreSQL uses a text file (pg_hba.conf) to configure which IP addresses it'll allow connections from. Redash will generally give an error message with details about your source IP not being allowed when this is the problem. Generally it's not too hard to fix.

... and I'm pretty sure there's one more thing that's obvious which is not coming immediately to mind though. Hmmm, I probably need more coffee. :wink:

Anyway, the above 3 should get you started in resolving the problem. If the connection is just timing out when it tries to connect, then it's probably either item 1 or 2 above.