无法创建用于 Memcached 服务的“PRIVATE CONNECTIONS TO SERVICES”

Unable to create "PRIVATE CONNECTIONS TO SERVICES" to use for Memcached service

提问人:devops on the road 提问时间:11/17/2023 更新时间:11/17/2023 访问量:5

问:

按照文档:

https://cloud.google.com/sql/docs/postgres/configure-private-services-access#allocate-ip-address-range

我一直在尝试创建一个私有连接,以便能够创建一个Memcached实例(因为我在尝试创建Memcached实例时收到此错误)

命令: gcloud memcache instances create instance-one-memcached --node-count=1 --node-cpu=1 --node-memory=1GB --region=europe-west1 --zones=europe-west1-b --memcached-version=1.5

结果:

ERROR: (gcloud.memcache.instances.create) FAILED_PRECONDITION: Google private service access is not enabled. Enable private service access and try again. For information on enabling private service access, see https://cloud.google.com/service-infrastructure/docs/enabling-private-services-access
com.google.cloud.memcache.action.validator.sn.ServiceNetworkingException: <eye3 title='FAILED_PRECONDITION'/> generic::FAILED_PRECONDITION: Google private service access is not enabled. Enable private service access and try again. For information on enabling private service access, see https://cloud.google.com/service-infrastructure/docs/enabling-private-services-access

从 GCP 控制台或使用 gcloud 命令创建“PRIVATE CONNECTIONS TO SERVICES”失败

命令: gcloud services vpc-peerings connec --service=servicenetworking.googleapis.com --ranges=google-managed-services-one-vpc --network=net-one-vpc -project=proj-one

结果:

ERROR: (gcloud.services.vpc-peerings.connect) The operation "operations/pssn.p24-719941109999-d25a7fa1-412f-4fd5-ace8-75acf6c9943f" resulted in a failure "Cannot modify allocated ranges in CreateConnection. Please use UpdateConnection.
Help Token: AZ-7fWLZ_U_RQbchXmaYK0WCFVFtlYHYW72o0aEMipuTjzE9kD1ja82MELMMRv-bMvoEjYIdJTHJMIpDm16uv437QhqtOSdNZeXMTkBaMxIK2N5t".
Details: "[<DetailsValueListEntry
 additionalProperties: [<AdditionalProperty
 key: '@type'
 value: <JsonValue
 string_value: 'type.googleapis.com/google.rpc.PreconditionFailure'>>, <AdditionalProperty
 key: 'violations'
 value: <JsonValue
 array_value: <JsonArray
 entries: [<JsonValue
 object_value: <JsonObject
 properties: [<Property
 key: 'type'
 value: <JsonValue
 string_value: 'googleapis.com'>>, <Property
 key: 'subject'
 value: <JsonValue
 string_value: '171070'>>]>>]>>>]>, <DetailsValueListEntry
 additionalProperties: [<AdditionalProperty
 key: '@type'
 value: <JsonValue
 string_value: 'type.googleapis.com/google.rpc.ErrorInfo'>>, <AdditionalProperty
 key: 'reason'
 value: <JsonValue
 string_value: 'FLOW_SN_PF_UPDATE_PEERING_MODIFY_RANGE_IN_CREATE'>>, <AdditionalProperty
 key: 'domain'
 value: <JsonValue
 string_value: 'servicenetworking.googleapis.com'>>]>]".

我有两个子网,其范围如下:

sub-one-private-subnet  europe-west1             net-one-vpc  10.4.0.0/16    IPV4_ONLY
sub-one-public-subnet   europe-west1             net-one-vpc  10.2.0.0/16    IPV4_ONLY

我有一个“与服务的专用连接”:

Connection name | Assigned allocation | Service producer
servicenetworking-googleapis-com | sub-one-db-subnet | Google Cloud Platform

我正在使用范围-one-db-subnet 10.3.0.0/24

并具有两个“为服务分配的 IP 范围”:

services-one-subnet    =>    10.5.0.0/16
google-managed-services-one-vpc    =>    10.89.0.0/16

如何创建“PRIVATE CONNECTIONS TO SERVICES”,这是我这边的问题吗?还是文档缺少什么?

谷歌云平台

评论


答:

1赞 Yvan G. 11/21/2023 #1

我尝试复制这个问题,我使用此链接成功创建了一个 memcached,我所做的是在创建 memcached 下,我选择了我创建的自定义 vpc。我还设置了专用服务访问的连接,并选择“使用自动分配的 IP 范围”,然后单击继续。几分钟后,它将显示已建立的连接。下面是我的复制截图。

我还使用您的子网来确保它不是 IP 地址问题。

imageimageimage