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.
MIT License
1.31k stars 276 forks source link

Can not get value from aws elasticache cluster correctly. #346

Open yiwong2001 opened 5 years ago

yiwong2001 commented 5 years ago

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. 
yiwong2001 commented 5 years ago

Can I know which hash ring algorithms are supported?

3rd-Eden commented 5 years ago

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