Skip to main content

Utilize Elasticache Auto Discovery For Redis with RedisInsight


Profile picture for Ajeet Raina
Author:
Ajeet Raina, Former Developer Growth Manager at Redis

RedisInsight is a 100% free Redis GUI that allows you to visualise, monitor, and optimize while developing your applications with Redis. It provides an intuitive and efficient GUI for Redis allowing developers like you to interact with your databases and manage your data. RedisInsight comes with the compatibility to connect to your database through the Sentinel instance too. Please note that RedisInsight v2.0 is an open source visual tool built by Redis that lets you do both GUI- and CLI-based interactions with your Redis database.

RedisInsight lets you automatically add Redis Enterprise Software and Redis Enterprise Cloud databases. RedisInsight also allows you to automatically discover Elasticache Redis caches.

note

ElastiCache Redis caches cannot be accessed from outside the VPC, as they don’t have public IP addresses assigned to them.If you want to work with ElastiCache Redis caches with RedisInsight, you can either setup an SSH tunnel between RedisInsight and your Elasticache instance, in case you're not using Redis Cluster.

This tutorial shows how to:

  • Setup and configure Amazon Elasticache
  • Configure the VPC
  • Configuring the security groups
  • Configure and setup Amazon EC2
  • Create and configure IAM role
  • Assign the permissions
  • Connect to Elasticache from EC2 instance
  • Setup RedisInsight
  • Access RedisInsight
  • Autodiscover Elasticache Instance

Step 1. Setup and configure Amazon Elasticache

Login to AWS Management Console and click "Get Started now"

elasticache

Choose "Redis" as the cluster engine

elasticache

Configure Redis settings:

elasticache

Copy and save the Elasticache primary endpoint URL:

elasticache

Step 2. Configure the VPC

Configure and chose VPC that has your ElastiCache instances

elasticache

Step 3. Configure the Security Groups

elasticache

Configure inbound and outbound rules to allow RedisInsight and Redis ports:

elasticache

Step 4. Configure and setup Amazon EC2

elasticache

Step 5. Create and configure IAM role

You can use the AWS Management Console to create a role that an IAM user can assume

elasticache

Under Select type of trusted entity, choose EC2. In other words, the role is used by an EC2 instance

elasticache

Click “Next”.

Step 6. Assign the permissions

Assign the below permissions:

  • AmazonS3ReadOnlyAccess
  • AmazonElastiCacheReadOnlyAccess

elasticache

Step 7. Connect to Elasticache from EC2 instance

Use the redis-cli command to connect to the remote Amazon Elasticache for Redis server endpoint URL.

 ubuntu@ip-10-0-0-254:~$ redis-cli -h redisinsightdemo.8cfnjo.ng.0001.use1.cache.amazonaws.com -p 6379
redisinsightdemo.8cfnjo.ng.0001.use1.cache.amazonaws.com:6379>

Step 8. Setup RedisInsight

In order to access the RedisInsight GUI, run the following Docker command:

 ubuntu@ip-10-0-0-254:~$ sudo docker run -v redisinsight:/db -p 8001:8001 redislabs/redisinsight:latest
Unable to find image 'redislabs/redisinsight:latest' locally
latest: Pulling from redislabs/redisinsight
 sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
caf3d674fb81 redislabs/redisinsight:latest "bash ./docker-entry…" 4 seconds ago Up 3 seconds 0.0.0.0:8001->8001/tcp, :::8001->8001/tcp cool_pascal

Step 9. Access RedisInsight

To access the RedisInsight GUI, open your preferred browser and access https://localhost:8001

elasticache elasticache

Step 10. Autodiscover Elasticache Instance

note

In case you encounter the below error message:

This EC2 instance does not have permissions to discover your ElastiCache instances. To grant permission, create an IAM role with the DescribeCacheClusters permission and attach the role to this EC2 instance.

You might have to attach IAM role to the instance as shown below:

elasticache

Now you can should be able to autodiscover Elasticache

elasticache

elasticache

Add the selected instance:

elasticache

Add the discovered instance:

elasticache

References

Redis Launchpad