[英]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: 两个问题:
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.