是否可以通过 Google云端SQL ? //cloud.google/appengine/docs/managed-vms/rel =nofollow> Google Managed VM ?使用常规的Google App Engine应用程序,我可以通过在Cloud SQL控制台中授权我的项目并使用 unix_socket ='/ cloudsql /'+ _INSTANCE_NAME 进行连接。但是, / cloudsql / 套接字似乎在托管虚拟机上不可用。我必须将我的Managed VM应用程序的IP列入白名单吗?如果是这样,我该如何找到白名单的IP地址?
解决方案 / cloudsql / 套接字仅在常规App Engine中可用。受管VM是常规VM,因此与Cloud SQL的连接需要使用该Cloud SQL实例的外部IP。外部IP需要列入白名单。外部IP显示在开发人员控制台中,也可以通过gcloud CLI工具检索。避免将GCE VM的IP列入白名单的两个选项是: / p>
我们知道这些是非常满意的解决方案: - (
Is it possible to connect to Google Cloud SQL from a Google Managed VM? With regular Google App Engine applications, I can connect by authorizing my project in the Cloud SQL console and using unix_socket='/cloudsql/' + _INSTANCE_NAME. However, the /cloudsql/ socket doesn't seem to be available on Managed VMs. Do I have to whitelist the IP of my Managed VM application? If so, how do I find the IP address to whitelist?
解决方案The /cloudsql/ sockets are only available in regular App Engine. Managed VMs are regular VMs so connection to Cloud SQL needs to use the external IP of that Cloud SQL instances. The external IP needs to be whitelisted. The external IP is showed in the Developers Console and can also be retrieved via gcloud CLI tool.
Two options to avoid having to whitelist the IP of the GCE VMs are:
We are aware that none of these are very satisfying solutions. :-(
更多推荐
是否可以通过Google Managed VM连接到Google Cloud SQL?
发布评论