Adding a Redis instance
Now, let's connect RedisInsight to a Redis Server. We can start by connecting to redis server running on localhost.
If the connection is successful, you should start seeing statistics for this redis server.
- RedisInsight can only connect to redis servers that your redis-cli can connect to.
If RedisInsight cannot connect to your redis server, check if you can connect using
- On mac and windows, if localhost does not work, try
host.docker.internalas the server name.
- On linux, if localhost does not work, restart docker with the
--network hostflag in the docker run command.
Connecting to ElastiCache
Connecting to AWS ElastiCache can be particularly problematic since 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 using RedisInsight, you can either:
If you are not using Redis Cluster, you can setup an SSH Tunnel between RedisInsight and your ElastiCache instance.
An SSH tunnel consists of an encrypted tunnel created through an SSH protocol connection.
Run this command to create an SSH tunnel:
ssh -f -N -L <local_port>:<elasticache_endpoint> -i <path_to_pem_file> <ec2_endpoint>
Go to Add Instance in RedisInsight and add an instance with:
Install RedisInsight on an EC2 instance that is in the same VPC and has access to the ElastiCache Redis cache. This is option yields the best performance and works with Redis Cluster.
Set up a VPN to your AWS VPC using AWS VPN. You can then access the ElastiCache Redis cache using the private endpoint.