简体   繁体   English

无法使用gcloud将私有IP(VPC)添加到新的Google Cloud SQL实例

[英]Can't add private IP (VPC) to new Google Cloud SQL instance with gcloud

I've being trying to create a new CloudSQL instance with a private IP attached from the get go. 我正在尝试使用从一开始就附加的私有IP创建新的CloudSQL实例。 The only thing documentation hints me is to add a VPC network. 文档唯一提示我的是添加VPC网络。 I'm trying to add the default one. 我正在尝试添加默认的一个。

First I'm enabling the correct APIs / services to my project: 首先,我要为我的项目启用正确的API /服务:

gcloud services enable servicenetworking.googleapis.com servicemanagement.googleapis.com --project=my-project

Then I'm trying to create the CloudSQL instance: 然后,我尝试创建CloudSQL实例:

gcloud beta sql instances create cloudsql-instance-name --region=europe-west1 --project=my-project --network=projects/my-project/global/networks/default

However this gives me this non descriptive error: 但这给了我这个非描述性的错误:

ERROR: (gcloud.beta.sql.instances.create) [INTERNAL_ERROR] Failed to create subnetwork. Please create Service Networking connection with service 'servicenetworking.googleapis.com' from consumer project '1234567890' network 'default' again.

Two questions: 两个问题:

  1. Is this the correct way to add a private IP to an instance upon creation? 这是在创建实例时将私有IP添加到实例的正确方法吗? Or are there other ways? 还是有其他方法?
  2. Why is it giving me this error and how can I resolve? 为什么给我这个错误,我该如何解决?

Thanks! 谢谢!

You need to create an " Allocated IP ranges for services " and a " Private connections to services " inside the VPC that you want to have CloudSQL Instance. 您需要在要具有CloudSQL实例的VPC内创建“ 服务的IP分配范围 ”和“ 服务的专用连接 ”。 (In your case is "default" VPC). (您的情况是“默认” VPC)。 Once you have both you should be able to create the MYSQL Instance. 两者都拥有后,您应该能够创建MYSQL实例。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法通过对等VPC网络访问具有私有IP的Google Cloud SQL - Can't access Google Cloud SQL with private IP from peered VPC network 想要使用 terraform 在 gcp 中的单独 vpc 上创建具有私有和公共 ip 的云 sql 实例 - Want to create a cloud sql instance with private and public ip on a separate vpc in gcp using terraform 我可以使用 gcloud sql 命令在我的 Google Cloud Sql 实例上运行 sql 文件吗 - Can I run an sql file on my Google Cloud Sql instance using the gcloud sql command 从具有私有和公共 IP 的虚拟机连接到私有 IP 上的 Google Cloud SQL 实例失败 - Connecting to Google Cloud SQL instance on private IP from a VM with both private and public IPs fails 为什么VM无法使用VPC网络,static内部IP,连接到谷歌云平台ZC6E195553E6C7AC8592C389ACB9878A050AZ中的SSH? - Why can't VM with VPC networks, static internal IP, connect to SSH in Google Cloud Platform Web Console? Gcloud 从 Cloud SQL 实例导出到 Google Storage 作为.sql 文件 - Gcloud Export to Google Storage from Cloud SQL instance as .sql file 将第二个内部/私有IP地址添加到google cloud vm实例 - Add 2nd internal/private ip address to google cloud vm instance 如何使用私有 IP 在两个项目之间共享 Google Cloud SQL 实例? - How to share a Google Cloud SQL instance between two projects using private IP? 如何从我的电脑连接到谷歌云平台中私有 ip 的 sql 实例 - How to connect from my pc to sql instance with private ip in google cloud platform Google Cloud SQL实例错误IP地址 - Google Cloud SQL Instance Error IP Address
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM