Getting Started with AWS
Boosting MySQL database performance
with Amazon ElastiCache for Redis
Module 1: Create a Redis Cluster
To get started, you will set up your first Redis Cluster and configure its node type and security group.
What You Will Learn
- How to set up your first Redis Cluster
- How to configure its node type and security group
Time to Complete
Open the ElastiCache Dashboard
Open the ElastiCache Dashboard, then:
1.1 - On the top right corner, select the region where you launched your EC2 instance.
1.2 — Click on “Get Started Now”.
1.3 — Select “Redis” as your Cluster engine.
To keep the tutorial straight forward, leave the Cluster Mode enabled option unchecked. More information about Cluster Mode enabled can be found here.
1.4 — Choose a name for your Redis Cluster, e.g. “elc-tutorial”.1.5 — Change the Node type to cache.t2.micro.That node type is fine for this tutorial, but for a production cluster the size of the node should depend on your workload and you should start with the m5 or r5 instance families.
1.6 — Set Number of replicas to 1.
That read-only replica will allow you to scale your reads. In case of a failure, an automatic failover will be triggered and the replica will take over the role of the primary node.
Advanced Redis Settings
1.7 — Check the box for “Multi-AZ with Auto-Failover”.
In the unlikely event of a primary node or Availability Zone failure, or even in cases of planned maintenance, ElastiCache for Redis can replace the failing instance and the replica takes over the role of the primary node. As a result, downtime is minimized.
1.8 — Select a Subnet group.
If you need more information about Subnet groups, please refer to the documentation.
1.9 — For Preferred availability zone(s), select “No preference”.
For this example we won’t use encryption, but keep in mind you can configure both encryption for data at-rest and for data in-transit.
1.10 — Select a Security group for your Redis Cluster.
This is important: make sure the Security group you select allows incoming TCP connections on port 6379 from your EC2 instance. If that’s not the case, you won’t be able to connect to your Redis nodes.
Import data to cluster
For this example, we won’t load any seed RDB file so we can skip this configuration step altogether. Just keep in mind that this option is available.
Daily backups are important for most use cases, and a good recommendation is to enable backups with a retention period that will give you enough time to act in case anything unexpected happens. For this tutorial, we won’t use any backups.
1.11 — Uncheck “Enable automatic backups”.
1.12 — Specify a maintenance window that suits your needs.
Here you can think about the time and day when your application has a low workload. For our current needs, we can just state “No preference”.
Review and create
After a review of all the fields in the form, click “Create”.
An ElastiCache for Redis cluster will be launched as shown:
When the ElastiCache for Redis cluster is ready for use it will appear as shown with a status of available and 2 nodes: