Creating and Configuring MemoryDB Clusters
Step 1: Go to AWS management console and search for the Amazon MemoryDB for Redis.
Step 2 : On the left side of your screen, click on the Clusters to create a new cluster or view your clusters. After clicking on the clusters, click on the create clusters to add a new cluster.
Step 3: After clicking on create new cluster, fill all mandatory details asked by AWS management console to add a new cluster. Fill out the necessary details using the instruction below or you can take the help from the Aws management console center.
Property |
Description |
---|---|
Cluster Info |
Select the Create new cluster option. Give the name to your cluster and Description(optional) about the cluster. |
Subnet Group |
Select create new subnet group and Fill out the Name, Description, and VPC ID of the cluster. The VPC ID can be new or existing according to AWS Console to run your cluster. |
Others |
In the other, fill out the necessary details like Port 6379 (which can run in all the available zones), Parameter group (select the default.memorydb-redis6),node (default), Number of shards and replicas per shards (according to your cluster usage). |
Advanced Setting |
You can manage the security according to you or can use the Encryption key (default key) to manage it by AWS management console. |
Inbound Rules & Snapshot |
Select the Port 6379 (default)under the inbound rules and Enable automatic snapshots. Enter the snapshot retention period according to you and select the snapshot window as no preference or specify the snapshot window accordingly. |
Maintenance Window |
Select the No preference for default setting or Select your own preference Maintenance Window and fill out the mandatory setting according to you. |
Step 4: Click on the create cluster. It may take 15-20 minutes to create your cluster and get it ready to configure so you need to wait for your cluster to complete and configure it.
Step 5: Till your cluster gets ready to use, Go to EC2 Services and Click on the launch instances to create a new instance. Later, configure this instance with your cluster and console to work into your MemoryDB.
Step 6: Select the AMI (Amazon Machine Image) you want according to the purpose and use of your instance in the cluster. However, for best ultra performance and free cost, use the Amazon kernel 5.10 64-bit (*86). Then Review and launch it.
Step 7: Wait for your instance to get ready and check out the position of your cluster. Keep refreshing it to check the position of the instance and the cluster. Once both are done, Go to the cluster and copy the Endpoint of your cluster.
Step 8: Now Connect your EC2 Instance created by you and wait for the console to open.
Step 9: After establishing the connection to your instance and configuring your cluster and instance, follow the following command to access your cluster and read, write your MemoryDB Cluster. Now for that, Install the Redis CLI. Connect to your EC2 instance via SSH using the private key associated with your instance.
wget http://download.redis.io/redis-stable.tar.gz
Step 10: Run the following command to initialize the Redis CLI to the environment and your Cluster.
tar xvzf redis-stable.tar.gz
cd redis-stable
make distclean
make redis-cli BUILD_TLS=yes
Sudo install -m 755 src/redis-cli /usr/local/bin/
Step 11: Connect to your MemoryDB Cluster From EC2 by: Then you will be connected to your cluster and access you MemoryDB.
src/redis/-cli -c -h #copy the endpoint copied from your cluster page and run the code
What Is Memory DB? Creating And Configuring MemoryDB Clusters
A Memory DB known as a “Memory Database” is a type of open-source data storage that is designed in such a way that it can perform the read and write operations very quickly. It is made for applications that need very high-speed data speed and low latency response. This MemoryDB is Durable in nature and was built for modern applications with microservices architectures.
A MemoryDB Cluster is made up of multiple nodes that are interconnected and distributed such that they share and manage the data very quickly. The use of the MemoryDB cluster has eliminated the need to separate and manage a cache and durable database.