Getting Started Guide API Version 2011-07-15awsdocs.s3.amazonaws.com/ElastiCache/2011-07-15/... ·...
Transcript of Getting Started Guide API Version 2011-07-15awsdocs.s3.amazonaws.com/ElastiCache/2011-07-15/... ·...
Amazon ElastiCacheGetting Started Guide
API Version 2011-07-15
Amazon ElastiCache: Getting Started GuideCopyright © 2011 Amazon Web Services LLC or its affiliates. All rights reserved.
Amazon ElastiCache Getting Started Guide
Table of ContentsGet Started with Amazon ElastiCache ............................................................................................................... 1Sign Up for Amazon ElastiCache ....................................................................................................................... 2Create a Cache Cluster ...................................................................................................................................... 3Authorize Access ................................................................................................................................................ 7Connect to a Cache Node .................................................................................................................................. 9Delete Your Cache Cluster ............................................................................................................................... 12Where Do I Go from Here? .............................................................................................................................. 14Please Provide Feedback ................................................................................................................................. 17About This Guide .............................................................................................................................................. 18
Amazon ElastiCache Getting Started Guide
Get Started with AmazonElastiCache
Amazon ElastiCache is a web service that makes it easy to set up, manage, and scale distributedin-memory cache environments in the cloud. It provides a high performance, resizeable, and cost-effectivein-memory cache, while removing the complexity associated with deploying and managing a distributedcache environment. Amazon ElastiCache is protocol-compliant with Memcached, so the code, applications,and most popular tools that you use today with your existing Memcached environments will work seamlesslywith the service.
Note
For more information about Memcached, go to http://memcached.org.
This guide walks you through creating and connecting to your first Amazon ElastiCache Cache Cluster.
API Version 2011-07-151
Amazon ElastiCache Getting Started Guide
Sign Up for Amazon ElastiCache
To use Amazon ElastiCache, you need an AWS account. If you don't already have one, you'll be promptedto create one when you sign up for Amazon ElastiCache.
To sign up for Amazon ElastiCache
1. Go to http://aws.amazon.com/elasticache and click Sign Up for Amazon ElastiCache.
2. Follow the on-screen instructions.
Once you've signed up for Amazon ElastiCache, you'll be able to launch your own Cache Cluster.Jump to Create a Cache Cluster (p. 3).
API Version 2011-07-152
Amazon ElastiCache Getting Started Guide
Create a Cache Cluster
Now that you have signed up for Amazon ElastiCache, you're ready to create a Cache Cluster using theAWS Management Console.
Important
The Cache Cluster you're about to launch will be live (and not running in a sandbox).You willincur the standard Amazon ElastiCache usage fees for the instance until you delete it. The totalcharges will be minimal (typically less than a dollar) if you complete the exercise described herein one sitting and delete your Cache Cluster when you are finished. For more information aboutAmazon ElastiCache usage rates, go to the Amazon ElastiCache product page.
To launch a Cache Cluster
1. Start the launch wizard:
a. From the AWS Management Console page, select Amazon ElastiCache from the drop-downlist box, then click Sign in to the AWS Console and log in with the email address and passwordyou used when signing up for Amazon ElastiCache.
Tip
If you pause for a long period of time during this procedure, the AWS ManagementConsole automatically logs you out.To stay logged in while you work through this tutorial,click Settings in the top right corner of the console window and clear the Sign out oninactivity check box.
API Version 2011-07-153
Amazon ElastiCache Getting Started Guide
b. From the Amazon ElastiCache Console Dashboard, click Launch Cache Cluster to start theLaunch Cache Cluster Wizard.
The wizard opens on the Cache Cluster Details page.
2. Specify the name of your Cache Cluster by typing it into the Name text box.
3. Select the amount of memory you want for each Cache Node in your Cache Cluster by selecting aNode Type from the Node Type drop-down list box.
4. Select the number of Cache Nodes you want in your Cache Cluster by typing a number into theNumber of Nodes text box.
5. You can change the default port that your Cache Nodes will use to accept connections by typing itinto the Cache Port text box.
6. Leave the rest of the options on the Cache Cluster Details page at their default values, and clickthe Continue button.
7. After you click the Continue button, the Additional Configuration page opens.
API Version 2011-07-154
Amazon ElastiCache Getting Started Guide
8. The Additional Configuration page is where you can specify a Cache Security Group, CacheParameter Group, and Maintenance Window for you Cache Cluster. For this example, accept thedefault values, and then click the Continue button.
After you click the Continue button, the Review panel appears.
9. Review the options for your Cache Cluster:
• If you need to correct any options, click the Back button to return to previous panels and makecorrections.
• If all your options are entered correctly, click the Launch button to launch your new Cache Cluster.
After you click the Launch button, a message displays stating that your Cache Cluster is beingcreated.
This can take a few minutes to complete.
API Version 2011-07-155
Amazon ElastiCache Getting Started Guide
10. Click the Close button.
After you click the Close button, the My Cache Clusters panel appears.Your Cache Cluster appearsin the list on this page with the creating status until your Cache Cluster is created and ready for use.
Once your Cache Cluster changes to the available state, you need to authorize access so you canconnect to it. Jump to Authorize Access (p. 7).
API Version 2011-07-156
Amazon ElastiCache Getting Started Guide
Authorize Access
Now that you've created a Cache Cluster, you need to authorize access to the Cache Cluster.You dothis by granting an EC2 Security Group access to a Cache Security Group. The EC2 Security Groupgrants access to Amazon EC2 instances, and in turn the Cache Security Group grants access to theAmazon EC2 instances that are authorized for the EC2 Security Group.
Granting Access to the Cache ClusterIn this example, you authorize the default Cache Security Group.
To grant access to an EC2 Security Group for a Cache Security Group
1. Select Cache Security Groups from the navigation pane on the left side of the console window.
2. In the My Cache Security Groups list, select the check box next to the Cache Security Group nameddefault.
API Version 2011-07-157
Amazon ElastiCache Getting Started GuideGranting Access to the Cache Cluster
3. On the detail panel at the bottom of the window:
a. Type the name of the EC2 Security Group you wish to authorize into the EC2 Security Groupto Link text box.
b. Enter your AWS Account ID into the AWS Account Id text box.
Note
You can find your AWS Account ID in the upper right corner of the Security Credentialspage.
c. Click the Add button.
It takes approximately one minute for changes to access permissions to take effect.Your CacheSecurity Group will show a status of Authorizing next to the EC2 Security Group while theauthorization is in progress.
Now that you've authorized access to your Cache Cluster, you can connect to it. Jump to Connectto a Cache Node (p. 9).
API Version 2011-07-158
Amazon ElastiCache Getting Started GuideGranting Access to the Cache Cluster
Connect to a Cache Node
Important
This section assumes that you've created an Amazon EC2 instance and can connect to it. Forinstructions 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 yourCache Cluster is in the available state, you can connect to a Cache Node in the Cache Cluster.
Important
You can only connect to a Cache Node from an EC2 Instance that belongs to the EC2 SecurityGroup that you authorized in the Authorize Access (p. 7) section.
In the following example, you use the telnet utility to connect to the Cache Cluster you just created.
Note
For more information about Memcached and available Memcached commands, go tohttp://memcached.org.
To connect to a Cache Cluster using telnet
1. Find the endpoint of the Cache Node you want to connect to.
a. On the My Cache Clusters page of the AWS management Console, click the name of a CacheCluster.
The detail page for the Cache Cluster appears.
b. Click the Nodes tab at the top of the window.
c. On the Nodes tab of the detail window, note the endpoint of a Cache Cluster to use in the nextstep.
API Version 2011-07-159
Amazon ElastiCache Getting Started Guide
Note
The endpoint for your Cache Cluster isn't available until your Cache Cluster is in theavailable state.
2. Connect to your Amazon EC2 instance using the connection utility of your choice.
Note
For instructions on how to do this, please go to the Amazon EC2 Getting Started Guide.
3. On your EC2 instance, Open a command prompt and enter the following command; make sure touse 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 128.0.0.1...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 valuehello // Set value as “hello”STOREDget a // Get value for key “a”VALUE a 0 5helloENDget b // Get value for key “b” results in cache missEND>
API Version 2011-07-1510
Amazon ElastiCache Getting Started Guide
Once you're finished with your new Cache Cluster, make sure to delete it to avoid incurring further usagecharges. Jump to Delete Your Cache Cluster (p. 12).
API Version 2011-07-1511
Amazon ElastiCache Getting Started Guide
Delete Your Cache Cluster
As soon as your Cache Cluster becomes available, you’re billed for each hour or partial hour that youkeep the Cache Cluster running (even if the Cache Cluster is idle). Once you've decided that you nolonger need the Cache Cluster, you can delete it.
To delete your Cache Cluster
1. In the AWS Management Console, locate the Cache Cluster in your list of Cache Clusters on theMy Cache Clusters page.
2. Click the Delete link next to the Cache Cluster.
The Delete Cache Cluster confirmation dialog box appears.
3. Click the Yes, Delete button.
Amazon ElastiCache begins deleting the instance. The Cache Cluster status changes to deletingin the My Cache Clusters list.
API Version 2011-07-1512
Amazon ElastiCache Getting Started Guide
As soon as the Cache Cluster status changes to deleted, you stop incurring charges for that CacheCluster.
Congratulations! You successfully launched, authorized access to, connected to, and deleted a CacheCluster. For more information about Amazon ElastiCache and how to continue, see Where Do I Go fromHere? (p. 14).
API Version 2011-07-1513
Amazon ElastiCache Getting Started Guide
Where Do I Go from Here?
Topics
• Other Ways to Access Amazon ElastiCache (p. 14)
• Amazon ElastiCache Resources (p. 15)
Amazon ElastiCache is a rich service offering many things we haven't covered in this guide, such ascontrolling maintenance schedules, monitoring your Cache Clusters, security features, and more. Thissection provides links to additional resources, which will help you deepen your understanding and useof Amazon ElastiCache.
Other Ways to Access Amazon ElastiCacheThis guide has shown you how to launch and delete a Cache Cluster using the AWS ManagementConsole.You can continue using Amazon ElastiCache through the console, or try one of the otherinterfaces.
Continue Using the ConsoleThe AWS Management Console includes many other functions besides just launching and deleting CacheClusters. To learn more about how to use Amazon ElastiCache through the console, consult the onlineHelp to assist you (just click the Help button in the console) or go to the Amazon ElastiCache User Guide.
Use the Command Line InterfaceFor information on using Amazon ElastiCache's Java-based command line interface, go to the AmazonElastiCache User Guide.These command line tools are a fast way to execute all of the Amazon ElastiCachefunctions without coding to the API or using a library.
Use an Existing LibraryIf you prefer to use Amazon ElastiCache through a programmatic interface, there are libraries andresources available for the following languages:
• Java
• PHP
API Version 2011-07-1514
Amazon ElastiCache Getting Started GuideOther Ways to Access Amazon ElastiCache
• Ruby
• Windows and .NET
For libraries and sample code in all languages, go to the Amazon ElastiCache Sample Code & Libraries.
Code Directly to the Web Service APIIf you want to write code directly to the Amazon ElastiCache web service APIs, go to the AmazonElastiCache User Guide. The guide describes how to create and authenticate API requests, and how touse Amazon ElastiCache through the APIs. For a complete description of all the API actions, go to theAmazon ElastiCache API Reference.
Amazon ElastiCache ResourcesThe table below lists related resources that you'll find useful as you work with this service.
DescriptionResource
The User Guide provides conceptual information aboutAmazon ElastiCache and describes how to use AmazonElastiCache features using the AWS Management Console,API, and command line tools.
Amazon ElastiCache User Guide
The API Reference contains a comprehensive description ofall Amazon ElastiCache Query APIs and data types.
Amazon ElastiCache API Reference
The Command Line Reference contains a comprehensivedescription of all the command line tools and their options.
Amazon ElastiCache Command LineReference
The FAQ covers the top questions developers have askedabout this product.
Amazon ElastiCache Technical FAQ
The release notes provide a high-level overview of the currentrelease.They specifically note any new features, corrections,and known issues.
Release notes
A central starting point to find documentation, code samples,release notes, and other information to help you buildinnovative applications with AWS.
AWS Developer Resource Center
The AWS Management Console allows you to perform mostof the functions of Amazon ElastiCache without programming.
AWS Management Console
A community-based forum for developers to discuss technicalquestions related to Amazon Web Services.
Discussion Forums
The home page for AWS Technical Support, including accessto our Developer Forums, Technical FAQs, Service Statuspage, and Premium Support.
AWS Support Center
The primary web page for information about AmazonElastiCache.
Amazon ElastiCache product information
API Version 2011-07-1515
Amazon ElastiCache Getting Started GuideCode Directly to the Web Service API
DescriptionResource
A central contact point for inquiries concerning AWS billing,account, events, abuse etc.
Contact Us
Detailed information about the copyright and trademark usageat Amazon.com and other topics.
Conditions of Use
API Version 2011-07-1516
Amazon ElastiCache Getting Started GuideAmazon ElastiCache Resources
Please Provide Feedback
Your input is important to help make our documentation helpful and easy to use. Please tell us aboutyour experience getting started with Amazon ElastiCache by completing our Getting Started Survey.
Thank you.
API Version 2011-07-1517
Amazon ElastiCache Getting Started Guide
About This Guide
This is the Amazon ElastiCache Getting Started Guide. It was last updated on September 16, 2011.
API Version 2011-07-1518
Amazon ElastiCache Getting Started Guide