问题
I was trying to setup Elastic cache (memcached engine) & use in my .NET application through a memcache c# client API "Enyim".
I'm new to AWS and facing some problems. I have few questions :-
Question 1 : Can I access my cache cluster nodes from my local machine ?
Question 2 : What is the process of setting up complete AWS Elastic cache instance. Correct me if i'm wrong :-
Setup VPC (by default) Setup a security group in EC2 (by default) Setup cache cluster as with same VPC. Now how can i use this same cache cluster ?
I have setup the memcache engine on local & the same code through Enyim was running but i was not able to run same (get/set) code for the Elasticache node instances.
回答1:
As far as Question #1, I am certain when using the redis flavor of elastic cache you cannot (according to aws never will be able) to access the cache from anywhere except within AWS.
For debugging purposes it would be nice to be able to, but in production mode, accessing the cache from outside aws would introduce sufficient latency to defeat any benefit you might get from using the cache in the first place.
回答2:
It is not possible to directly access Elasticache from outside AWS, however it can be done using an SSH tunnel through an EC2 instance on the same VPC. Here is how to setup SSH tunnel: http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/
Here is a full C# example about how to use Elasticache: http://www.omidmufeed.com/how-to-use-elasticache-memcached-or-runtime-caching-in-c/
来源:https://stackoverflow.com/questions/22594837/using-elasticache-through-c-sharp