Can you connect to Amazon Elasticache Redis outsid

2019-01-12 22:18发布

I'm able to connect to an Elasticache redis instance in a VPC from EC2 instances, but I would like to know if there is a way to connect to an Elasticache Redis node outside of Amazon EC2 instances, such as from my local dev setup or VPS instances provided by other vendors.

Currently when trying from my local set up:

redis-cli -h my-node-endpoint -p 6379

I only get a timeout after some time.

8条回答
2楼-- · 2019-01-12 23:02

SSH port forwarding should do the trick. Try running this from you client.

ssh -f -N -L6379:<your redis node endpoint>:6379 <your EC2 node that you use to connect to redis>

Then from your client

redis-cli -h 127.0.0.1 -p 6379

It works for me.

Please note that default port for redis is 6379 not 6739. An also make sure you allow the allow the security group of the EC2 node that you are using to connect to your redis instance into your Cache security group.

Also, AWS now supports accessing your cluster more info here

查看更多
\"骚年 ilove
3楼-- · 2019-01-12 23:04

No, you can't without resorting to 'tricks' such as a tunnel, which maybe OK for testing but will kill any real benefit of using a super-fast cache with the added latency/overhead.

...an Amazon ElastiCache Cluster, inside or outside a VPC, is never allowed to be accessed from the Internet.

From here: http://aws.amazon.com/elasticache/faqs/#Can_I_access_Amazon_ElastiCache_from_outside_AWS

EDIT 2018: This answer above was accurate when written, however it is now possible with some configuation to access redis cache from outside using the directions approximately 1/2 way down this page: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/accessing-elasticache.html

查看更多
登录 后发表回答