0

We use memcached in Java. Our environment runs on OpenShift Online (PaaS) and we have currently one "gear" running our backend java application and one "gear" running memcached.

Since it would be cheaper, we like to migrate to AWS ElastiCache - but without changing our current memcached client, which is xmemcached. But how do we have to deal with the authentication? I tried [Access Key ID] / [Secret Access Key]:

MemcachedClient memcachedClient;

MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses([aws node endpoint]));
builder.setCommandFactory(new BinaryCommandFactory());
builder.addAuthInfo(AddrUtil.getOneAddress([aws node endpoint]), AuthInfo.plain([Access Key ID], [Secret Access Key]));

memcachedClient = builder.build();

No success. I get always an exception:

net.rubyeye.xmemcached.exception.MemcachedException: There is no available connection at this moment

The same exception I get, if I do no authentication at all.

I know that it would be bether to use the AWS client; but since we actually use only one node, we do not need auto discovery. The point is that we do have some other memcached servers e.g. in the testing / local environment, which are probably not supported by the aws client (or am I wrong?).

badera
  • 1,495
  • 2
  • 24
  • 49
  • ElastiCache does not use authentication. You almost certainly have a networking issue you need to solve. Is the security group open? Where is the client running? http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Access.Outside.html – Mark B Aug 29 '16 at 13:07
  • OK, this seems to be the problem. Well, the client should run in a OpenShift Online application. OpenShift Online itself is hosted on AWS; but it is most certainly not possible to share the security group. – badera Aug 29 '16 at 13:16
  • You might look into using redislabs.com Memcached Cloud service instead. – Mark B Aug 30 '16 at 12:13

0 Answers0