I am setting up a connection to a CloudSQL Postgres instance from Datastream via private connection. I have referred to the similar questions in the community I could find, and taken the following steps but still haven't been successful:
When I attempted to test the connection profile before adding the startup script to the reverse proxy, and adding custom advertised route, I got a timeout error. Now that I've taken those steps, I get the following error:
```
We can't connect to the source database using the specified hostname and port. Make sure that the hostname and port are correct and that the database can accept inbound connections.
```
My questions:
1) What do I need to change to get datastream connected to my cloudsql instance via private connectivity?
2) will a reverse proxy intercept all traffic to the db (i'm especially concerned about traffic from the app it is the backend db for), or will it be used only for datastream traffic? If all traffic, what impact might I expect on performance of requests to the db? Would using cloudsql auth proxy versus reverse proxy be more performant?
Solved! Go to Solution.
Update--we were able to get the connection working after restarting the proxy VM--this may be necessary to apply the newly added startup script.
Hi @lorenh,
Welcome to Google Cloud Community!
I understand that your test connection fails for connecting Datastream and PostgreSQL database using private connectivity. After reviewing the steps that you've taken, I can confirm that this should already have worked. Here are some additional troubleshooting points that may help:
Also, there is already a filed feature request to allow the Datastream directly connect to PostgreSQL on private IP without a reverse proxy. You can make a follow up or vote on the request if the above troubleshooting still didn’t fix your issue. However, please be informed that I can’t provide a timeline as to when this will be implemented.
I hope the above information is helpful.
Thanks @ronnelg, when i've tried to ping the internal IP address from the reverse proxy VM, it did not return any packets. do you have an idea why this might be, especially since i can successfully psql into the db instance from the reverse proxy VM via the private ip address for the cloud sql instance?
Additionally, can you clarify how I might "verify that the reverse proxy forwards traffic to the source (and not from it)" as described in the reverse proxy documentation?
Update--we were able to get the connection working after restarting the proxy VM--this may be necessary to apply the newly added startup script.