I have an java app running in an EC2 instance which use lettuce (https://lettuce.io/) to talk to a redis cluster on AWS ElasticCache.
The java app can connect with no issue. Here is the netstat output:
tcp6 0 0 10.0.56.94:45846 10.0.34.61:6379 ESTABLISHED
tcp6 0 0 10.0.56.94:33198 10.0.33.125:6379 ESTABLISHED
tcp6 0 0 10.0.56.94:57526 10.0.32.189:6379 ESTABLISHED
I have logged on to the same ec2 instance and tried to use redis-cli
to conneect the the same cluster. However I have no success with the redis-cli.
The redis uri the java application is something like this:
rediss://my-project-0001-001.my-project.abczy.use1.cache.amazonaws.com:6379,my-project-0002-001.my-project.abczy.use1.cache.amazonaws.com:6379,my-project-0003-001.my-project.abczy.use1.cache.amazonaws.com:6379
However if I apply this uri to redis-cli
, it throws an error: "invalid uri scheme".
The error is suppressed if I replace rediss
with redis
in the uri. But I still cannot connect to the cluster.
There are alternatives I have tried (and they simply do 'not doing anything': no error message at all. Simply not showing anything.)
Connect to the node directly
redis-cli -c -h my-project-0001-001.my-project.abczy.use1.cache.amazonaws.com -p 6379 -a auth_token
Connect to the configration end point
redis-cli -c -h clustercfg.my-project.abczy.use1.cache.amazonaws.com -p 6379 -a auth_token
Use IP directly
# Use netstat to find out the IPs
redis-cli -c -h 10.0.34.61 -p 6379 -a auth_token
Use IP directly without -c
flag
redis-cli -h 10.0.34.61 -p 6379 -a auth_token
How can I find out why redis-cli is not connecting? Is there anyway I can trace the routes?