本页面简要介绍了适用于 Memorystore for Memcached 的 Auto Discovery 服务。如需了解如何访问和连接 Auto Discovery 服务,请参阅使用 Auto Discovery 服务。
Auto Discovery 服务是一种程序化方式,可让客户端根据您扩缩 Memcached 实例时发生的情况,自动添加和移除节点 IP 地址。
如果您不使用 Auto Discovery 服务,则必须在扩缩期间手动管理 Memcached 客户端中的节点 IP 地址列表。手动管理节点 IP 地址列表会增加额外开销,因为您必须确保在实例扩缩时客户端得以更新。Auto Discovery 将自动为您处理这项工作。
您应使用 Auto Discovery 端点来实现其预期目的,而不是运行 Memcached 命令,例如 get、set 和 delete。
Auto Discovery 服务架构概览
Memorystore for Memcached 使用“发现端点”公开 Auto Discovery 服务。发现端点是实例的专用 IP 地址,用于返回 Memcached 实例中的当前节点列表。每个 Memorystore for Memcached 实例都有一个独一无二的发现端点。 创建实例后,发现端点的 IP 地址不能更改。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-05。"],[],[],null,["# About the Auto Discovery service\n\nThis page provides an overview of the Auto Discovery service for\nMemorystore for Memcached. To learn how to access and connect to the Auto Discovery\nservice, see [Using the Auto Discovery Service](/memorystore/docs/memcached/using-auto-discovery).\n\nThe Auto Discovery service is a programmatic way for clients to automatically\nadapt to the addition and removal of node IP addresses that happens when you\n[scale](/memorystore/docs/memcached/scaling-instances) your Memcached instance.\n\nIf you don't use the Auto Discovery service, you must manually manage the node\nIP address list in your memcached client during scaling. Manually managing the\nnode IP address list adds additional overhead because you must ensure that the\nclients are updated as the instance scales up and down. The Auto Discovery helps\nto automate this work for you.\n\nYou should use the Auto Discovery endpoint for its intended purpose, and not\nto run Memcached commands such as `get`, `set`, and `delete`.\n\nOverview of Auto Discovery service architecture\n-----------------------------------------------\n\nMemorystore for Memcached exposes the Auto Discovery service using a *discovery\nendpoint*. The discovery endpoint is a dedicated IP address for your instance\nthat returns a current list of nodes in your Memcached instance. Every\nMemorystore for Memcached instance has a unique discovery endpoint. Once the\ninstance is created, the IP address of the discovery endpoint does not change.\n\nTo get the instance's Auto Discovery information, you query the discovery\nendpoint. The discovery endpoint returns the following information:\n\nMemorystore for Memcached directly exposes the discovery endpoint, however auto\ndiscovery must also be available in your client libraries. There are two ways to\nhave auto discovery in your clients:\n\n1. Use a client library that supports auto discovery.\n\n - [Golang](https://github.com/google/gomemcache) memcached client fork.\n2. Manually add auto discovery logic to your client library.\n\nAuto Discovery service behavior\n-------------------------------\n\nThe Auto Discovery service is eventually consistent. There can be a delay (on\nthe order of seconds) while the Auto Discovery node list catches up to the\ncurrent cluster configuration after a scaling operation.\n\nEventual consistency, in addition to the distributed nature of the service,\ncan produce the following behavior for clients. The client logic should be\ndesigned to account for this behavior:\n\n- Same client on two separate queries to the Auto Discovery service can receive\n two different Auto Discovery responses from the service (while the service is\n inconsistent). However, one of the responses has a higher `Configuration\n version ID` which clients can use to handle the responses.\n\n- Two clients can receive two different Auto Discovery responses from the\n service (while the service is inconsistent), but they don't have a way to find\n which one is latest as clients don't talk to each other. While in this state,\n the instance can return cache misses. In this scenario, clients have to wait\n for the Auto Discovery service to become consistent.\n\nWhat's next\n-----------\n\n- Learn how to [Use the Auto Discovery service](/memorystore/docs/memcached/using-auto-discovery).\n- Review the available [Memcached configurations](/memorystore/docs/memcached/memcached-configs)."]]