e-Zest members share technology ideas to foster digital transformation.

How to Implement AWS ElastiCache

Written by Swapnil Jadhav | Jun 28, 2013 3:48:05 PM

Amazon ElastiCache: a new service that makes it easy to add distributed in-memory caching to any application. Amazon ElastiCache is compliant with Memcached, which makes it easy for developers who are already familiar with that system to start using the service immediately. Existing applications, tools and libraries that are using a Memcached environment can simply switch over to using Amazon ElastiCache without much effort.

To launch a cache cluster:

  1. Sign in to the AWS Management Console and open the Amazon ElastiCache console
  2. From the Amazon ElastiCache Console Dashboard, click Launch Cache Cluster to start the Launch Cache Cluster Wizard.
    It will open Launch Cache Cluster Wizard window.

  3. Specify the name of your cache cluster by typing it into the Name text box.
  4. Select the amount of memory you want for each cache node in your cache cluster by selecting a node type from the Node Type.
  5. Select the number of cache nodes you want in your cache cluster
  6. You can change the default port that your cache nodes will use to accept connections by typing it into the Cache Port text box.
  7. Select the Preferred zone of your choice and Disable the SNS notifications.
  8. After you click the Continue button, the Additional Configuration page opens.

  9. This is page 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.
  10. Then Review panel appears.

  11. If you need to correct any options, click the Back button to return to previous panels and make corrections.
  12. 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.

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

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 named default.

  3. Select the name of the EC2 Security Group you wish to authorize into the EC2 Security Group Drop down box.
  4. Click the Add button.
  5. Your cache security group will show a status of Authorizing next to the EC2 Security Group while the authorization is in progress.

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

To connect to a cache cluster using telnet

  1. On the Cache Clusters page of the AWS Management Console, click the name of a cache cluster.
    The detail page for the cache cluster appears.
  2. Click the Nodes tab at the top of the window.
  3. On the Nodes tab of the detail window, note down the endpoint of a cache nodes 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.

    Below is the window for Nodes tab: The Nodes tab contains information about each of the Cluster Nodes in the selected cluster. Note down the Endpoint of cache node

  4. On your EC2 instance, which belongs to your selected Security group in previous step, open a command prompt and enter the following command; make sure to use the endpoint of the cache cluster you created.

    > telnet iws-cache-cluster.n3vrvk.cfg.use1.cache.amazonaws.com 11211
    Trying 10.194.167.75...
    Connected to iws-cache-cluster.n3vrvk.cfg.use1.cache.amazonaws.com.
    Escape character is '^]'.

    You are now connected to Cache Node.

To delete the Cache Cluster:

  1. Select the Cache cluster tab in the navigation pane on left side of window.
  2. Here you can get Modify Reboot Delete tab on the right side of window
  3. Click on Modify if you want to modify Cache Cluster otherwise Click on Delete to delete cache cluster.