-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "How the Cloud SQL Proxy Works" section to README #1841
Comments
Hi @runephilosof-karnovgroup, thanks for raising an issue on the Cloud SQL Proxy 😄 When you run the proxy and specify the port value (5432 in your case) that is setting the port for the local connection. (as seen in below diagram) The Cloud SQL Proxy that you run is the proxy client, it has a server-side companion that automatically runs and is configured alongside a Cloud SQL instance when it is created. The server-side component listens on port 3307 (TCP standard port in diagram above) of your Cloud SQL instance’s IP address for incoming connections from the client. This is what you are seeing in the error message. The connection to your instance's IP address on port 3307 is timing out. (most likely caused by a network path issue, as you mentioned the server can not be reached) I will discuss with our team and see if this error message can be improved to make this more clear. We are also looking to add a more detailed version of the diagram to our README in hopes that helps as well. Diagram is from How the Cloud SQL Auth Proxy works |
@runephilosof-karnovgroup I have change this issue to track adding a similar "How the Cloud SQL Proxy Works" section from our official Google Cloud docs to our README with the diagram above. I think a lot of people would benefit from this. Thanks for getting this jump started! Have a great day - Jack |
Hi @jackwotherspoon - hope it's ok to add here; the migration guide states different ports to 3307 (from the "How the Cloud SQL Proxy Works" section).
Does this need updated, or am I miss understanding what it's saying? |
Also Line 151 in 51cc2c6
Since 3307 is actually sometimes used for MySQL for the local connection proxy client if you do not specify a port and it detects MySQL (if I understand it correctly). So maybe the server side proxy component should be using a port number that does not resemble any of the ports normally used by the databases (are the proxy components using ssh, then maybe just 22 or a port number resembling ssh, for instance 2222). |
@sean-conkie Absolutely okay to add I can hopefully clarify for you. @runephilosof-karnovgroup I will answer your confusion here too. There seems to be a bit of confusion and hopefully this will be more clear once we add this new section to the docs with the diagram etc. The ports that you both have referenced ("MySQL 3306, Postgres 5432, SQL Server 1433", and "3306, 3307, 3308") are all for the local connection. So when you run the Cloud SQL Proxy locally it binds one or several of these ports (depending on type of database and how many instances you are configuring) to your localhost. So if I run the following: # starts the Proxy listening on localhost with the default database engine port
# For example:
# MySQL 127.0.0.1:3306
# Postgres 127.0.0.1:5432
# SQL Server 127.0.0.1:1433
./cloud-sql-proxy <INSTANCE_CONNECTION_NAME> As per the comment it will bind and begin listening for connections on
The issue with port This is the error you are seeing: |
Bug Description
The error message says port
3307
, but I have specified port5432
.The output from sql proxy
Example code (or command)
From my deployment
Stacktrace
No response
Steps to reproduce?
...
Environment
See the example code for the environment
Additional Details
No response
The text was updated successfully, but these errors were encountered: