Unable to connect to AWS ElastiCache clusters using Membase client lib for memcached

Question:

I am having problems with get/set to an ElastiCache cluster from my EC2 instance. I am getting – SEVERE: net.spy.memcached.OperationTimeoutException: Timeout waiting for value – error.

When I am trying to get or set a value. I used the same code on my local machine (albeit communicating with a local memcached server) and everything works fine. The complete stacktrace can be found here – http://pastebin.com/tYcCJ6cj

I first saw that can I at least get the IP address of all the nodes of a cluster so that I can feed it in to my membase client & I am indeed able to find out the node ip addresses.
I also made sure that all my EC2 security groups are added to the default cache cluster security group as well.

Any pointers on this will be greatly helpful.

UPDATE

Code snippet used to fetch a particular record.

Code snippet used to connect to the ElastiCache server

Answer:

Use the modified ElastiCache Cluster client produced by Amazon.

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html#AutoDiscovery.ClusterClient

According to the documentation, to download the ElastiCache Cluster Client:

  1. Sign in to the AWS Management Console and open the ElastiCache console at https://console.aws.amazon.com/elasticache/.
  2. From the ElastiCache console, click Download ElastiCache Cluster Client.

The source code for the ElastiCache Cluster Client for Java is available at https://github.com/amazonwebservices/aws-elasticache-cluster-client-memcached-for-java. This library is based on the popular Spymemcached client. The ElastiCache Cluster Client is released under the Amazon Software License. You are free to modify the source code as you see fit; you can even incorporate the code into other open source Memcached libraries, or into your own client code.

Currently the version is 1.0.1. I have been using version 1.0 without any problems for over a year.

Leave a Reply