문제

Is there any way to access cache nodes from local development environment? Although the same cache nodes are accessible from EC2 instance.

I'm using Enyim memcache client library with C#. I found few article saying this is not possible then what should be best approach. Should i need to setup memcache locally for development work?

도움이 되었습니까?

해결책 3

When you create your Elastic Cache cluster, you have to define a Security Group. A Security group is a set of rules that define what IP addresses are authorised to connect to your cluster.

Should you want to connect to your cache cluster from your local machine, be sure to add a rule to authorise your local IP address to connect to the cluster (beware if you're behind a NATing gateway or a proxy, you need to use your external IP address and not your internal IP address)

Details are available at : http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/GettingStarted.CreateCacheCluster.html

Security Group is explained at : http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html

--Seb

다른 팁

According to Amazon, there is no accessing elasticache clusters from outside AWS:

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

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

Also see this question:

Can you connect to Amazon Elasticache Redis outside of Amazon

You can create ssh tunnel:

$ ssh -nNT -L 11211:<elasticache instance public dns name>:11211 ubuntu@<ec2 instance> -i <path to your pem file>
  • -L means local port forwarding
  • -nNT means no tty allocated and no commands executed on remote side

for example:

$ ssh -nNT -L 11211:blah-blah.cfg.use1.cache.amazonaws.com:11211 ubuntu@ec2-54-254-254.compute-1.amazonaws.com -i ~/.ssh/mykey.pem

And in another console you can connect to localhost:

telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top