ElastiCache/2012 11 15/elasticache gsg 2012 11 15


297KB Größe 10 Downloads 410 Ansichten
Amazon ElastiCache Getting Started Guide API Version 2012-11-15

Amazon ElastiCache Getting Started Guide

Amazon ElastiCache: Getting Started Guide Copyright © 2013 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. The following are trademarks of Amazon Web Services, Inc.: Amazon, Amazon Web Services Design, AWS, Amazon CloudFront, Cloudfront, Amazon DevPay, DynamoDB, ElastiCache, Amazon EC2, Amazon Elastic Compute Cloud, Amazon Glacier, Kindle, Kindle Fire, AWS Marketplace Design, Mechanical Turk, Amazon Redshift, Amazon Route 53, Amazon S3, Amazon VPC. In addition, Amazon.com graphics, logos, page headers, button icons, scripts, and service names are trademarks, or trade dress of Amazon in the U.S. and/or other countries. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon.

Amazon ElastiCache Getting Started Guide

Get Started with Amazon ElastiCache ................................................................................................... 1 Sign Up for Amazon ElastiCache ........................................................................................................... 2 Create a Cache Cluster .......................................................................................................................... 3 Authorize Access .................................................................................................................................... 7 Connect to a Cache Node ...................................................................................................................... 9 Delete Your Cache Cluster .................................................................................................................... 11 Where Do I Go from Here? ................................................................................................................... 13 Please Provide Feedback ..................................................................................................................... 16 About This Guide .................................................................................................................................. 17

API Version 2012-11-15 3

Amazon ElastiCache Getting Started Guide

Get Started with Amazon ElastiCache Amazon ElastiCache is a web service that makes it easy to set up, manage, and scale distributed in-memory cache environments in the cloud. It provides a high performance, resizeable, and cost-effective in-memory cache, while removing the complexity associated with deploying and managing a distributed cache 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 seamlessly with 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 2012-11-15 1

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 prompted to create one when you sign up for Amazon ElastiCache.

To sign up for Amazon ElastiCache 1. 2.

Go to http://aws.amazon.com/elasticache and click Sign Up for Amazon ElastiCache. 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 2012-11-15 2

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 the AWS Management Console.

Important The cache cluster you're about to launch will be live (and not running in a sandbox). You will incur the standard Amazon ElastiCache usage fees for the instance until you delete it. The total charges will be minimal (typically less than a dollar) if you complete the exercise described here in one sitting and delete your cache cluster when you are finished. For more information about Amazon ElastiCache usage rates, go to the Amazon ElastiCache product page.

Note To create a cache cluster in an Amazon Virtual Private Cloud (VPC), go to Using Amazon ElastiCache with Amazon Virtual Private Cloud (VPC) in the Amazon ElastiCache User Guide.

To launch a cache cluster 1.

Start the launch wizard: a. b.

Sign in to the AWS Management Console and open the Amazon ElastiCache console at https://console.aws.amazon.com/elasticache/. From the Amazon ElastiCache Console Dashboard, click Launch Cache Cluster to start the Launch Cache Cluster Wizard. The wizard opens on the Cache Cluster Details page.

API Version 2012-11-15 3

Amazon ElastiCache Getting Started Guide

2. 3. 4. 5. 6. 7.

Specify the name of your cache cluster by typing it into the Name text box. Select the amount of memory you want for each cache node in your cache cluster by selecting a node type from the Node Type drop-down list box. Select the number of cache nodes you want in your cache cluster by typing a number into the Number of Nodes text box. You can change the default port that your cache nodes will use to accept connections by typing it into the Cache Port text box. Leave the rest of the options on the Cache Cluster Details page at their default values, and click the Continue button. After you click the Continue button, the Additional Configuration page opens.

API Version 2012-11-15 4

Amazon ElastiCache Getting Started Guide

8.

The Additional Configuration page is where you can specify a cache security group, cache parameter group, and maintenance window for your cache cluster. For this example, accept the default 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 make corrections. • 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 being created. This can take a few minutes to complete.

10. Click the Close button. After you click the Close button, the My Cache Clusters panel appears.Your cache cluster appears in the list on this page with the creating status until your cache cluster is created and ready for use.

API Version 2012-11-15 5

Amazon ElastiCache Getting Started Guide

Once your cache cluster changes to the available state, you need to authorize access so you can connect to it. Jump to Authorize Access (p. 7).

API Version 2012-11-15 6

Amazon ElastiCache Getting Started Guide Granting Access to the Cache Cluster

Authorize Access

Now that you've created a cache cluster, you need to authorize access to the cache cluster. You do this by granting an EC2 Security Group access to a cache security group. The EC2 Security Group grants access to Amazon EC2 instances, and in turn the cache security group grants access to the Amazon EC2 instances that are authorized for the EC2 Security Group.

Granting Access to the Cache Cluster In this example, you authorize the default cache security group. To grant access to an EC2 Security Group for a cache security group 1. 2.

Select Cache Security Groups from the navigation pane on the left side of the console window. In the My Cache Security Groups list, select the check box next to the cache security group named default.

API Version 2012-11-15 7

Amazon ElastiCache Getting Started Guide Granting 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 Group to 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 Credentials page. c.

Click the Add button.

It takes approximately one minute for changes to access permissions to take effect. Your cache security group will show a status of Authorizing next to the EC2 Security Group while the authorization is in progress.

Now that you've authorized access to your cache cluster, you can connect to it. Jump to Connect to a Cache Node (p. 9).

API Version 2012-11-15 8

Amazon ElastiCache Getting Started Guide

Connect to a Cache Node

Important 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.

Important 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 (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 to http://memcached.org. To connect to a cache cluster using telnet 1.

Find the endpoint of the cache node you want to connect to. a.

b. c.

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.

Note The endpoint for your cache cluster isn't available until your cache cluster is in the available state.

API Version 2012-11-15 9

Amazon ElastiCache Getting Started Guide

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 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 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 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. Jump to Delete Your Cache Cluster (p. 11).

API Version 2012-11-15 10

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 you keep the cache cluster running (even if the cache cluster is idle). Once you've decided that you no longer need the cache cluster, you can delete it.

To delete your cache cluster 1. 2.

In the AWS Management Console, locate the cache cluster in your list of cache clusters on the My Cache Clusters page. 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 deleting in the My Cache Clusters list.

API Version 2012-11-15 11

Amazon ElastiCache Getting Started Guide

As soon as the cache cluster status changes to deleted, you stop incurring charges for that cache cluster. Congratulations! You successfully launched, authorized access to, connected to, and deleted a cache cluster. For more information about Amazon ElastiCache and how to continue, see Where Do I Go from Here? (p. 13).

API Version 2012-11-15 12

Amazon ElastiCache Getting Started Guide AWS Account and Security Credentials

Where Do I Go from Here? Topics • AWS Account and Security Credentials (p. 13) • Other Ways to Work With Amazon ElastiCache (p. 13) • Amazon ElastiCache Resources (p. 14) Amazon ElastiCache is a rich service offering many things we haven't covered in this guide, such as controlling maintenance schedules, monitoring your cache clusters, security features, and more. This section provides links to additional resources, which will help you deepen your understanding and use of Amazon ElastiCache.

AWS Account and Security Credentials So far you signed up for the service, got an AWS account and security credentials, and then completed a short exercise covering the essential product functions. Now that you're finished with the exercise, we recommend that you check with an administrator or coworker in your organization to determine if he or she already has an AWS account and security credentials for you to use in future interactions with AWS. If you're an account owner or administrator and want to know more about AWS Identity and Access Management, go to the product description at http://aws.amazon.com/iam or to the technical documentation at Using IAM.

Other Ways to Work With Amazon ElastiCache This guide has shown you how to launch and delete a cache cluster using the AWS Management Console. You can continue using Amazon ElastiCache through the console, or try one of the other interfaces.

Continue Using the Console The AWS Management Console includes many other functions besides just launching and deleting cache clusters. To learn more about how to use Amazon ElastiCache through the console, consult the online Help to assist you (just click the Help button in the console) or go to the Amazon ElastiCache User Guide.

API Version 2012-11-15 13

Amazon ElastiCache Getting Started Guide Use the Command Line Interface

Use the Command Line Interface For information on using Amazon ElastiCache's Java-based command line interface, go to the Amazon ElastiCache User Guide.These command line tools are a fast way to execute all of the Amazon ElastiCache functions without coding to the API or using a library.

Use an AWS Software Development Kit (SDK) If you prefer to use Amazon ElastiCache through a programmatic interface, you can use an AWS Software Development Kit (AWS SDK) for your programming language. The AWS SDKs simplify programming by handling authentication, request signing, and other low-level details. For more information about using the AWS SDKs, go to http://aws.amazon.com/code.

Code Directly to the Web Service API If you want to write code directly to the Amazon ElastiCache web service APIs, go to the Amazon ElastiCache User Guide. The guide describes how to create and authenticate API requests, and how to use Amazon ElastiCache through the APIs. For a complete description of all the API actions, go to the Amazon ElastiCache API Reference.

Amazon ElastiCache Resources The table below lists related resources that you'll find useful as you work with this service. Resource

Description

Amazon ElastiCache User Guide

The User Guide provides conceptual information about Amazon ElastiCache and describes how to use Amazon ElastiCache features using the AWS Management Console, API, and command line tools.

Amazon ElastiCache API Reference

The API Reference contains a comprehensive description of all Amazon ElastiCache Query APIs and data types.

Amazon ElastiCache Command Line Reference

The Command Line Reference contains a comprehensive description of all the command line tools and their options.

Amazon ElastiCache Technical FAQ

The FAQ covers the top questions developers have asked about this product.

Release notes

The release notes provide a high-level overview of the current release. They specifically note any new features, corrections, and known issues.

AWS Developer Resource Center

A central starting point to find documentation, code samples, release notes, and other information to help you build innovative applications with AWS.

AWS Management Console

The AWS Management Console allows you to perform most of the functions of Amazon ElastiCache without programming.

Discussion Forums

A community-based forum for developers to discuss technical questions related to Amazon Web Services.

API Version 2012-11-15 14

Amazon ElastiCache Getting Started Guide Amazon ElastiCache Resources

Resource

Description

AWS Support Center

The home page for AWS Technical Support, including access to our Developer Forums, Technical FAQs, Service Status page, and Premium Support.

Amazon ElastiCache product information The primary web page for information about Amazon ElastiCache. Contact Us

A central contact point for inquiries concerning AWS billing, account, events, abuse etc.

Conditions of Use

Detailed information about the copyright and trademark usage at Amazon.com and other topics.

API Version 2012-11-15 15

Amazon ElastiCache Getting Started Guide

Please Provide Feedback Your input is important to help make our documentation helpful and easy to use. Please tell us about your experience getting started with Amazon ElastiCache by completing our Getting Started Survey. Thank you.

API Version 2012-11-15 16

Amazon ElastiCache Getting Started Guide

About This Guide This is the Amazon ElastiCache Getting Started Guide. It was last updated on 22 August 2012.

API Version 2012-11-15 17