|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
This section assumes that you've created an Amazon EC2 instance and can connect to it. For instructions on how to do this, please go to the Amazon EC2 Getting Started Guide.
Once you've authorized access to the cache cluster using the AWS Management Console and your
cache cluster is in the
available state, you can connect to a cache
node in the cache cluster.
You can only connect to a cache node from an EC2 instance that belongs to the EC2 Security Group that you authorized in the Authorize Access section.
In the following example, you use the telnet utility to connect to the cache cluster you just created.
For more information about Memcached and available Memcached commands, go to http://memcached.org.
To connect to a cache cluster using telnet
Find the endpoint of the cache node you want to connect to.
On the My Cache Clusters page of the AWS Management Console, click the name of a cache cluster.
The detail page for the cache cluster appears.
Click the Nodes tab at the top of the window.
On the Nodes tab of the detail window, note the endpoint of a cache cluster to use in the next step.
The endpoint for your cache cluster isn't available until your cache cluster is in the
Connect to your Amazon EC2 instance using the connection utility of your choice.
For instructions on how to do this, please go to the Amazon EC2 Getting Started Guide.
On your EC2 instance, open a command prompt and enter the following command; make sure to use the endpoint of the cache cluster you created.
PROMPT> telnet myfirstcacheinstance.evdfes.0001.use1.cache.amazonaws.com 11211
You will see output similar to the following.
Trying 220.127.116.11... Connected to myfirstcacheinstance.evdfes.0001.use1.cache.amazonaws.com. Escape character is '^]'. >
You are now connected to a cache node and may run Memcached commands. For example:
set a 0 0 5 // Set key “a” with no expiration and 5 byte value hello // Set value as “hello” STORED get a // Get value for key “a” VALUE a 0 5 hello END get b // Get value for key “b” results in cache miss END >
Once you're finished with your new cache cluster, make sure to delete it to avoid incurring further usage charges. Click the following button.