Using ElastiCache through C#

戏子无情 提交于 2019-12-11 03:18:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!