-1

Is it possible that redis cli is given less priority to connect when memory consumption is high but application is allowed to communicate?

I am unable to connect via cli so can't check anything. Also, don't have the redis server access.

We connect without authentication -

redis-cli -h <hostname>

I ran a process which inserted too many redis keys and that caused this situation. Now, I am not able to delete those keys. I am afraid, the other necessary keys would get evicted as old and system would start doing processing for things not available in redis.

Not able to connect via telnet as well.

  • Is it possible to connect via a Python script at this point?
  • If I restart the Java application, will it be able to connect anymore?
  • Will redis server access via AWS console be able to delete any of the key patterns? I don't have the access currently, so not able to confirm myself. Never used via it also.

Update

Following are graphs taken from AWS console, over the last 1 day since this issue happened -

enter image description here enter image description here

Update

I went through the FAQ of elasticache, but did not find any mention of being able to manage the data at key value pair level or presence of some special privilege users like root in case of MySql which is able to connect when no other users are able to connect.

All I found is cluster level management capabilities.

LeoMurillo
  • 6,048
  • 1
  • 19
  • 34
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
  • Have you considered to restart the redis instance? With no direct access to the server itself it will be very difficult to debug and figure out what is going on. If you pushed too many items in the cache, there is a chance that your server is failing since running out of memory, hence why you can't remotely connect. – kevinj Aug 13 '19 at 18:51
  • There is lot of data in redis. Last time we faced a similar issue, there were too many API calls which started to happen to get the data which was not found in redis. So, I am looking for a way to connect to redis and just delete those additional keys. – Sandeepan Nath Aug 13 '19 at 18:54
  • I'm not really sure what you're asking here. Are you trying to figure out how to purge excess keys? Most likely, the VM your redis instance is running on has run out of RAM and is now swapping data out to disk. – Andrew Eisenberg Aug 16 '19 at 07:09
  • Yes I want to cleanup the excess keys before going ahead. Is memory increasing the only option now? – Sandeepan Nath Aug 16 '19 at 07:22

2 Answers2

1

From the question it is not clear whether the redis-cli -h <host> command you're running is from within the EC2 or it is from you local machine (Outside AWS VPC).

Accessing from EC2

You will have to ensure following points:

  • Both the EC2 instance and Redis Instance are on the same VPC.
  • The security group on EC2 should be allowing port 6379 (It should already be if an application is able to access Redis on the same EC2)

Accessing from outside Amazon VPC

This is not something that's preconfigured and I will suggest that you go through the Accessing Your Cluster docs under the heading "How to Access ElastiCache Resources from Outside AWS".

Maurice
  • 11,482
  • 2
  • 25
  • 45
piyushkantm
  • 584
  • 5
  • 19
0

First, check the connectivity from source(Generally Ec2 instance) to Target (Redis Host). We can use simple command for that like

#curl -v hostIP(or dnsName):Port
#curl -v myredis.com:6379  or curl -v 192.17.37.42:6379 

If you see "Connected" then there is no issue with the network otherwise you have to look into network configurations like firewalls.

Next, you can connect to Redis using redis-cli with the below command:

#redis-cli -h myredis.com -p 6379
Jay Reddy
  • 630
  • 7
  • 6