网络

本页面简要介绍了 Memorystore for Memcached 的网络。如需查看常见网络错误的列表,请参阅网络错误场景

专用服务访问

Memorystore for Memcached 使用专用服务访问通道在您的项目和内部网络之间为某些 Google Cloud 服务(如 Cloud SQL、Memorystore for Redis 和 Memorystore for Memcached)创建网络对等互连。

也就是说,您必须先为网络建立专用服务访问通道连接,然后才能使用该网络创建 Memcached 实例。

使用专用服务访问通道连接,您可以受益于上述服务的可自定义集中式 IP 地址范围。如需了解如何选择特定 IP 范围分配,请参阅创建使用特定 IP 地址范围的 Memcached 实例

使用专用服务访问通道的本地访问

如果本地网络连接到 Memorystore for Memcached 实例所连接的 VPC 网络,则您可以从本地网络中的客户端进行连接。如要允许来自本地网络的连接,请执行以下操作:

  1. 使用以下选项之一确保您的共享 VPC 网络连接到您的本地网络
  2. 识别由专用服务连接生成的对等互连。Memorystore for Memcached 使用的对等互连名为 servicenetworking-googleapis-com
  3. 通过设置 --import-custom-routes--export-custom-routes 标志来更新对等互连连接以交换自定义路由
  4. 识别专用服务连接使用的分配范围
  5. 在管理 Cloud VPN 隧道或 Cloud Interconnect 连接 (VLAN) 的 BGP 会话的 Cloud Router 上,针对分配的范围创建 Cloud Router 自定义路由通告

传达网络要求

通常情况下,贵单位的网络团队和/或网络管理员负责设置专用服务访问通道连接。这样一来,网络团队就可以确保用于其他 Google Cloud 资源的 IP 地址或范围不会重叠,从而避免连接问题。

我们建议您联系贵组织中的网络安全团队,为您设置专用服务连接,尤其是在设置过程中遇到错误时。与您的网络团队联系时,请将以下信息发送给他们:

The Memorystore for Memcached instance cannot be created due to the following
error:

"Google private services access is not enabled. Enable privates service access
and try again."

Before an instance can be created, a private service access connection needs to
be established for network <project name: network>. Please refer to the
following Memorystore documentation links for more information on how to create
this connection:

* Networking.
* Establishing a private services access connection.
* Verifying a private services access connection.

IP 地址

每个 Memorystore for Memcached 实例都有一个发现端点,并且该实例中的每个节点都有自己的 IP 地址。您可以在 Google Cloud 控制台中或使用 gcloud memcache instances describe 查看这些 IP 地址。

节点和发现端点的 IP 地址不会更改。

支持的网络和客户端 IP 地址范围

支持以下网络或具有 RFC 1918 IP 地址的实例:
  • VPC 网络旧版网络除外)
  • 共享 VPC 网络
  • 本地系统
  • Compute Engine 虚拟机实例(172.17.0.0/16 除外,因为该 IP 地址范围已预留给内部组件)
  • 建议使用块大小至少为 /24 的专用服务访问范围,以支持 Memorystore for Memcached 和其他服务。不过,支持 Memorystore for Memcached 所需的最小块大小为 /26

后续步骤