このページでは、Memorystore for Memcached の Auto Discovery サービスの概要について説明します。Auto Discovery サービスにアクセスして接続する方法については、Auto Discovery サービスの使用をご覧ください。
Auto Discovery サービスは、Memcached インスタンスのスケーリング時に発生するノード IP アドレスの追加と削除に、クライアントが自動的に適応するプログラミング方法です。
Auto Discovery サービスを使用しない場合は、スケーリング中に Memcached クライアントのノード IP アドレスリストを手動で管理する必要があります。ノード IP アドレスリストを手動で管理すると、インスタンスのスケールアップやスケールダウンに合わせてクライアントを更新する必要があるため、オーバーヘッドが増えます。Auto Discovery を使用してこの作業を自動化できます。
Auto Endpoint を、get、set、delete などの Memcached コマンドを実行するためではなく、本来の用途で使用する必要があります。
Auto Discovery サービスのアーキテクチャの概要
Memorystore for Memcached は、ディスカバリー エンドポイントを使用して Auto Discovery サービスを公開します。ディスカバリー エンドポイントは、Memcached インスタンス内のノードの最新リストを返すインスタンス専用 IP アドレスです。すべての Memorystore for Memcached インスタンスには、固有のディスカバリー エンドポイントがあります。 インスタンスの作成後、検出エンドポイントの IP アドレスは変更されません。
インスタンスの Auto Discovery 情報を取得するには、ディスカバリー エンドポイントのクエリを実行します。ディスカバリー エンドポイントは次の情報を返します。
同じクライアントが Auto Discovery サービスへの 2 つのクエリを別々に実行すると、サービスから 2 つの異なる Auto Discovery レスポンスを受け取ることがあります(サービスに整合性がありません)。ただし、いずれかのレスポンスの高い方の Configuration
version ID は、クライアントがレスポンスの処理に使用できます。
2 つのクライアントはサービスから 2 つの異なる Auto Discovery レスポンス(サービスに整合性はありません)を受け取ることができますが、クライアントが互いに通信しないため、どちらを最新にするかはわかりません。このような状態で、インスタンスがキャッシュミスを返すことがあります。このシナリオでは、クライアントは Auto Discovery サービスの整合性がとれるまで待つ必要があります。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-08 UTC。"],[],[],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)."]]