This page explains how to find and connect to your Memcached instance's Auto Discovery service endpoint. For more information about Memorystore for Memcached's Auto Discovery service, see Auto Discovery service overview.
Finding your instance's discovery endpoint
You can find the discovery endpoint for your Memcached instance on the instance's details page in the Google Cloud console.
You can also view your Memcached instance's discovery endpoint by running the following command, replacing variables with appropriate values:
gcloud memcache instances describe instance-id --project=project --region=region --format="default(discoveryEndpoint)"
The values for the discovery endpoint are listed under the
discoveryEndpoint
label:
discoveryEndpoint: [IP-address]:[port-number]
Connecting to your instance's discovery endpoint using Telnet
To connect to your instance's discovery endpoint using Telnet, run the following command, replacing variables with appropriate values:
telnet discovery-endpoint-ip-address discovery-endpoint-port-number
Once connected to your Memorystore for Memcached instance's discovery endpoint using Telnet, run the following Memcached command to get the Configuration Version ID and Node List:
config get cluster
This command returns the following information in the following format:
CONFIG cluster 0 [length-of-payload-in-next-two-lines] [integer] [node1-ip]|[node1-ip]|[node1-port][node2-ip]|[node2-ip]|[node2-port] \r\n END\r\n
The last integer of the first line represents the number of bytes contained in the next two lines.
- If you are not configuring your parser, you can ignore this line.
- This line is helpful if you are programming your parser which may need to determine the length of the bytes to read from the request.
The second line is an integer, which is the Configuration Version ID described in Overview of Auto Discovery service architecture.
The third line is the Node List string, which contains the IP addresses and port numbers of the current nodes in your cluster.
What's next
- Learn more about Auto Discovery with the Auto Discovery service overview.
- View the available Memcached configurations.