3rd-Eden / memcached

A fully featured Memcached client build on top of Node.js. Build with scaling in mind so it will support Memcached clusters and consistent hashing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not get value from aws elasticache cluster correctly.

yiwong2001 opened this issue · comments

Hi guys,

I have been trying to get values memcached cluster on aws with no luck.

Those values were set by AWS java sdk with ketama as hash method. There are 5 nodes in cluster.

ConnectionFactoryBuilder connectionFactoryBuilder = new ConnectionFactoryBuilder();
        connectionFactoryBuilder.setLocatorType(Locator.CONSISTENT);
        connectionFactoryBuilder.setHashAlg(DefaultHashAlgorithm.KETAMA_HASH);
        ConnectionFactory connFactory = connectionFactoryBuilder.build();
        MemcachedClient client = new MemcachedClient(connFactory, endpoints)
```;

On the node js side, I checked ketama is set as default already.

But when I try to get data by keys, I only get around 28% of them.  

Can you suggest how to make both side work together? 

Thanks. 

Can I know which hash ring algorithms are supported?

It uses https://github.com/3rd-Eden/node-hashring can switch between libketama and hash_ring using options.