是否可以通过Google Managed VM连接到Google Cloud SQL?

编程入门 行业动态 更新时间:2024-10-26 02:32:00
本文介绍了是否可以通过Google Managed VM连接到Google Cloud SQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否可以通过 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>

  • 切换为仅使用SSL连接进行IP连接,并将白名单0.0.0.0/0。
  • 漏斗例如,通过运行TCP代理(HAProxy)的VM的所有到Cloud SQL的流量。
  • 我们知道这些是非常满意的解决方案: - (

    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:

  • Switch to use only SSL connections for IP connectivity and whitelist 0.0.0.0/0.
  • Funnel all the traffic to Cloud SQL via a VM that runs a TCP proxy (HAProxy) for example.
  • We are aware that none of these are very satisfying solutions. :-(

    更多推荐

    是否可以通过Google Managed VM连接到Google Cloud SQL?

    本文发布于:2023-10-23 23:06:42,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1522266.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:可以通过   连接到   Google   VM   Managed

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!